Created
February 18, 2011 19:01
-
-
Save turboladen/834201 to your computer and use it in GitHub Desktop.
Gets all tweets from a user into an single string of HTML
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
# Be sure to `gem install twitter` first, of course... | |
require 'rubygems' | |
require 'twitter' | |
tweets = "" | |
pages = 10 # The Twitter API paginates responses... | |
# Get all the tweets to a single String, where each is surrounded in HTML | |
(1..pages).each do |page| | |
Twitter.user_timeline("Fahrni", :page => page).each do |tweet| | |
tweets << "<p>#{tweet.text}</p>" | |
end | |
end | |
# Output to screen | |
puts tweets | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment