Skip to content

Instantly share code, notes, and snippets.

@brenes
Created November 3, 2011 00:11
Show Gist options
  • Select an option

  • Save brenes/1335386 to your computer and use it in GitHub Desktop.

Select an option

Save brenes/1335386 to your computer and use it in GitHub Desktop.
Change on the connect method on twitter-stream gem due to SSL requirements
# Starting on 2011/09/29 Twitter Streaming API requires SSL to access.
# Twitter stream gem is a gem built over EventMachine to get access to Twitter Streaming API
# Unfortunately Twitter Stream uses http by default, not https.
# We have to pass two extra options to the connect method
stream = Twitter::JSONStream.connect(
:path => "/1/statuses/filter.json?track=20N",
:auth => "USER:PASS",
# And the extra params!!
:port => 443,
:ssl => true
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment