Skip to content

Instantly share code, notes, and snippets.

@doombongo
Last active December 11, 2015 09:58
Show Gist options
  • Save doombongo/4583050 to your computer and use it in GitHub Desktop.
Save doombongo/4583050 to your computer and use it in GitHub Desktop.
getting nothing when running 'ruby tweetstream.rb'
# Returns a Tweet
#
# @see https://dev.twitter.com/docs/api/1.1/get/statuses/show/:id
# @rate_limited Yes
# @authentication_required Requires user context
# @raise [Twitter::Error::Unauthorized] Error raised when supplied user credentials are not valid.
# @return [Twitter::Tweet] The requested Tweet.
# @param id [Integer] A Tweet ID.
# @param options [Hash] A customizable set of options.
# @option options [Boolean, String, Integer] :trim_user Each tweet returned in a timeline will include a user object with only the author's numerical ID when set to true, 't' or 1.
# @example Return the Tweet with the ID 25938088801
# Twitter.status(25938088801)
def status(id, options={})
object_from_response(Twitter::Tweet, :get, "/1.1/statuses/show/#{id}.json", options)
end
require 'tweetstream'
TweetStream.configure do |config|
config.consumer_key = 'aefaeasefas'
config.consumer_secret = 'sefefqfq'
config.oauth_token = 'efwef ewf'
config.oauth_token_secret = 'abcdefghijk'
config.auth_method = :oauth
end
TweetStream::Client.new.track('tweet') do |status|
puts "#{status.text}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment