Created
April 3, 2010 02:45
-
-
Save mourdok/354039 to your computer and use it in GitHub Desktop.
API Twitter eg.2
This file contains hidden or 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
| require 'rubygems' | |
| require 'twitter' | |
| puts '------------' | |
| puts 'Basic search' | |
| puts '------------' | |
| puts "\n" | |
| Twitter::Search.new('mourdok').each do |tweet| | |
| puts "From user: #{tweet.from_user} | Text: #{tweet.text}" | |
| puts "Created at: #{tweet.created_at[0..15]}" | |
| puts "\n" | |
| end | |
| puts '-----------' | |
| puts 'Search from' | |
| puts '-----------' | |
| puts "\n" | |
| Twitter::Search.new('mourdok').from('edipofederle').each do |tweet| | |
| puts "From user: #{tweet.from_user} | Text: #{tweet.text}" | |
| puts "Created at: #{tweet.created_at[0..15]}" | |
| puts "\n" | |
| end | |
| puts '--------------' | |
| puts 'Search from/to' | |
| puts '--------------' | |
| puts "\n" | |
| Twitter::Search.new.from('mourdok').to('edipofederle').each do |tweet| | |
| puts "From user: #{tweet.from_user} | Text: #{tweet.text}" | |
| puts "Created at: #{tweet.created_at[0..15]}" | |
| puts "\n" | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment