【发布时间】:2015-10-11 22:22:30
【问题描述】:
有什么方法可以从任何位置的 twitter api 获取数据?
var sanFrancisco = ['79.86','12.62','80.28','13.21']
var stream = T.stream('statuses/filter', { locations: sanFrancisco })
stream.on('tweet', function (tweet) {
console.log(tweet)
它给出了一个错误:
错误:错误的 Twitter 流式传输请求:401
在 Object.exports.makeTwitError (/home/file_upload/node_modules/twit/lib/helpers.js:74:13)
在传入消息。 (/home/file_upload/node_modules/twit/lib/streaming-api-connection.js:95:29) 在 IncomingMessage.emit (events.js:117:20)
在 _stream_readable.js:943:16
在 process._tickCallback (node.js:419:13)
【问题讨论】:
-
你的问题是浏览器,你的代码显示的是服务器端代码?