Created
July 31, 2013 18:41
-
-
Save marksim/6124856 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requirements: | |
# | |
# gem install twitter | |
# open 'https://dev.twitter.com/apps/new' | |
# export TWITTER_CONSUMER_TOKEN='' | |
# export TWITTER_CONSUMER_SECRET='' | |
# export TWITTER_OAUTH_TOKEN='' | |
# export TWITTER_OAUTH_SECRET='' | |
require 'twitter' | |
Twitter.configure do |config| | |
config.consumer_key = ENV['TWITTER_CONSUMER_TOKEN'] | |
config.consumer_secret = ENV['TWITTER_CONSUMER_SECRET'] | |
config.oauth_token = ENV['TWITTER_OAUTH_TOKEN'] | |
config.oauth_token_secret = ENV['TWITTER_OAUTH_SECRET'] | |
end | |
Twitter.search("##{ARGV.first}", count: 100, result_type: 'recent').statuses.map do |tweet| | |
tweet.urls.map(&:expanded_url) | |
end.flatten.each.with_index do |url, i| | |
puts "#{i}) #{url}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment