如何使用Ruby收集实时推文并将其存储在MongoDB中?请给我一个提示!我试过使用这段代码1并且总是得到这个代码并且不知道如何处理它......
C:/Ruby187/lib/ruby/1.8/net/protocol.rb:135:in `sysread': 既存の接続はリモート
ホストに強制的に切断されました。 (Errno::ECONNRESET)
from C:/Ruby187/lib/ruby/1.8/net/protocol.rb:135:in `rbuf_fill'
from C:/Ruby187/lib/ruby/1.8/timeout.rb:67:in `timeout'
from C:/Ruby187/lib/ruby/1.8/timeout.rb:101:in `timeout'
from C:/Ruby187/lib/ruby/1.8/net/protocol.rb:134:in `rbuf_fill'
from C:/Ruby187/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
from C:/Ruby187/lib/ruby/1.8/net/protocol.rb:126:in `readline'
from C:/Ruby187/lib/ruby/1.8/net/http.rb:2028:in `read_status_line'
from C:/Ruby187/lib/ruby/1.8/net/http.rb:2017:in `read_new'
from C:/Ruby187/lib/ruby/1.8/net/http.rb:1051:in `request'
from stream.rb:19
from C:/Ruby187/lib/ruby/1.8/net/http.rb:543:in `start'
from C:/Ruby187/lib/ruby/1.8/net/http.rb:440:in `start'
from stream.rb:15
答案 0 :(得分:0)
尝试将网址从http://stream.twitter.com/1/statuses/sample.json
更改为https://stream.twitter.com/1/statuses/sample.json
,流API现在只能通过SSL使用(您链接到的Gist已有一年了)。