我尝试使用Node.js上的Twit显示用户在特定位置的关注者数量。在这个例子中,我试图向布里斯托尔的用户展示,但我只想显示他们拥有的粉丝数量。我不确定我在这里做错了什么,但它显示未定义
`
var Twit = require('twit');
var T = new Twit({
consumer_key: 'my # is here',
consumer_secret: 'my # is here',
access_token: 'my # is here',
access_token_secret: 'my # is here',
timeout_ms: 60*1000, // optional HTTP request timeout to apply to all requests.
})
var bristol = '51.454782,-2.596314,5mi';
var params = {
geocode: bristol,
count: 8
}
T.get('search/tweets', params, gotData);
function gotData(err, data, response) {
var tweets = data.statuses;
for (var i = 0; i < tweets.length; i ++){
console.log(tweets[i].followers_count);
}
}
`