小编UXW*_*ill的帖子

我正在尝试使用Node.js上的Twit回复推文

不确定如何输入in_reply_to_status_id.

它推文很好,只是不回复推文中的推文.

in_reply_to_status_id是Twit访问的Twitter API的一部分,但我可以在此上下文中使用它吗?

任何帮助将不胜感激.

这是代码:

var stream = T.stream('statuses/filter', { track: '@example'});

io.on('connection', function (socket) {
  socket.on('chat message', function (msg) {
    console.log('message: ' + msg);
    P.post('statuses/update', { status: '@example' + ' ' + msg}, function (err, data, response) {
      socket.emit('info', data.text);
      socket.emit('userPic', data.user.profile_image_url);
      console.log(data.user.profile_image_url);
    });
  });

  stream.start();

  stream.on('tweet', function (tweet) {
    console.log(tweet);
    // console.log('listening to tweets');

    if (tweet.text.indexOf('@example') > -1) {
      console.log("there is a tweet");
      var number = Date.now();
      var reply = replies[Math.floor(Math.random() * replies.length)];
      var name = '@' …
Run Code Online (Sandbox Code Playgroud)

javascript twitter node.js

5
推荐指数
1
解决办法
1851
查看次数

标签 统计

javascript ×1

node.js ×1

twitter ×1