Skip to content

Instantly share code, notes, and snippets.

@moski
Created January 10, 2015 19:56
Show Gist options
  • Save moski/21d830d0b0bd9e44a9ab to your computer and use it in GitHub Desktop.
Save moski/21d830d0b0bd9e44a9ab to your computer and use it in GitHub Desktop.
twitter_client.filter(track: hashtags.join(",")) do |tweet|
# Only Fetch tweets objects and ignore all retweets
if tweet.is_a?(Twitter::Tweet) && !tweet.retweet?
# only fetch tweets with images.
if tweet.media?
tweet_respresenter = Storage::Tweet.new.extend(TweetRepresenter).from_json(tweet.to_json)
tweet_respresenter.save!($redis)
print '.'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment