Created
October 25, 2012 04:30
-
-
Save zeke/3950418 to your computer and use it in GitHub Desktop.
A simple way to ingest tweets from a Twitter list.
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
%w(rubygems httparty pry).each {|lib| require lib } | |
class Twitter | |
include HTTParty | |
base_uri 'api.twitter.com/1' | |
def self.tweets_from_list(user, list, options={}) | |
options[:page] ||= 1 | |
options[:per_page] ||= 5 | |
get("/#{user}/lists/#{list}/statuses.json", options) | |
end | |
end | |
tweets = Twitter.tweets_from_list(:heroku, :crew) | |
binding.pry | |
tweets.each do |tweet| | |
puts "#{tweet["user"]["screen_name"]}: #{tweet["text"]}" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment