0
我正在使用Twit Node.js API。 我試圖做的是回覆一條與特定關鍵字匹配的推文。我希望我的回覆推文顯示在下面的其他推文內。就像當你通過應用程序或網站回覆。使用twit和Node.js回覆tweet
我的代碼做的是在這裏:
var reply = function(tweet) {
var res = {
status: 'This is a tweet',
in_reply_to_status_id: tweet.id_str
};
twitter.post('statuses/update', res,
function(err, data, response) {
console.log(data);
}
);
}
的狀態正確寫入答覆JSON但in_reply_to_status_id保持爲空。推文發佈到博客賬戶,但未回覆推文應該回復。
爲什麼它不起作用?
是的,我試圖寫入in_reply_to_status_id_str,我試圖使tweet.id_str一個字符串。
我有誰知道我錯過了什麼?
謝謝!
我的回答JSON是在這裏:
{ created_at: 'Wed Jun 21 07:44:22 +0000 2017',
id: 877431986071142400,
id_str: '877431986071142400',
text: 'This is a tweet',
truncated: false,
entities: { hashtags: [], symbols: [], user_mentions: [], urls: [] },
source: '<a href="https://example.com" rel="nofollow">Spatinator</a>',
in_reply_to_status_id: null,
in_reply_to_status_id_str: null,
in_reply_to_user_id: null,
in_reply_to_user_id_str: null,
in_reply_to_screen_name: null,
如果你需要更多的JSON輸入反應讓我知道的。