使用Twit NPM事件对象的Twitter API?

时间:2018-06-18 23:12:35

标签: javascript node.js twitter npm

我有以下代码,它使用node.js中的twit npm

var stream = T.stream('user')
//occurs anytime somone follows me
//The following code will be executed
//callback on followed
 stream.on('follow', followed);
 //callback that is triggered based on follow
 function followed(event){
console.log("Follow event "+event.source);

 var name=event.source.name;
 var screenName=event.source.screen_name;
 var r=Math.floor(Math.random()*100);

 tweetMessage('@'+screenName+" thanks for the follow "+r);
 }

我知道该事件是对twitters用户对象的回调,但我不明白" source"是吗?

0 个答案:

没有答案