Sha256: 428ae8969c9bb2283c0996c2fa0317b1d27b9361345e9f756aa9958d8ab32388
Contents?: true
Size: 784 Bytes
Versions: 15
Compression:
Stored size: 784 Bytes
Contents
$: << 'lib' << '../lib' require 'em-http' require 'em-http/middleware/oauth' require 'em-http/middleware/json_response' require 'pp' OAuthConfig = { :consumer_key => '', :consumer_secret => '', :access_token => '', :access_token_secret => '' } EM.run do # automatically parse the JSON response into a Ruby object EventMachine::HttpRequest.use EventMachine::Middleware::JSONResponse # sign the request with OAuth credentials conn = EventMachine::HttpRequest.new('http://api.twitter.com/1/statuses/home_timeline.json') conn.use EventMachine::Middleware::OAuth, OAuthConfig http = conn.get http.callback do pp http.response EM.stop end http.errback do puts "Failed retrieving user stream." pp http.response EM.stop end end
Version data entries
15 entries across 15 versions & 2 rubygems