Hello guys,
A beginner here trying to get started with user streams api and use
oauth.
I cannot seem to get the following code to work.
@consumer = OAuth::Consumer.new("consumer key", "consumer_secret")
@access = OAuth::Token.new("access_token", "access_secret")
- the consumer_key, consumer_secret,access_token, access_secret are
all replaced with actual values.
def start_stream
uri = URI.parse(URI.encode('https://userstream.twitter.com/2/
user.json'))
request = Net::HTTP::Get.new(uri.path)
http = Net::HTTP.start(uri.host, uri.port)
request.oauth!(http, @consumer, @access)
begin
http.request(request) do |response|
p response
end
ensure
http.finish
end
end
The error I get is a ruby http timeout
I am using are ruby oauth gem.
Any pointers to get started would be helpful.
Thank you for your help.
-Paul
--
Twitter developer documentation and resources: https://dev.twitter.com/doc
API updates via Twitter: https://twitter.com/twitterapi
Issues/Enhancements Tracker: https://code.google.com/p/twitter-api/issues/list
Change your membership to this group:
https://groups.google.com/forum/#!forum/twitter-development-talk