Skip to content

Instantly share code, notes, and snippets.

@lamdor
Created April 27, 2010 19:35
Show Gist options
  • Select an option

  • Save lamdor/381191 to your computer and use it in GitHub Desktop.

Select an option

Save lamdor/381191 to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'json'
require 'net/http'
SEARCH_URL = "http://search.twitter.com/search.json"
query = "?since_id=12957284923&q=%23fumullins"
def say(text)
system "say \"#{text}\""
end
loop do
puts "#{Time.now} - Finding tweets"
json = JSON.parse(Net::HTTP.get(URI.parse(SEARCH_URL + query)))
json["results"].each do |tweet|
say "A message from #{tweet["from_user"]}"
say tweet["text"]
end
query = json["refresh_url"]
sleep 15
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment