不确定如何输入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)