Skip to content

Instantly share code, notes, and snippets.

@joesavak
Created November 29, 2010 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joesavak/720600 to your computer and use it in GitHub Desktop.
Save joesavak/720600 to your computer and use it in GitHub Desktop.
twitter_search
def twitter_search(query,rpp,search_day)
base_url = "http://search.twitter.com/search.json"
url = "#{base_url}?q=#{URI.encode(query)}\&rpp=#{rpp}&since=#{search_day}&until=#{search_day}"
data = Net::HTTP.get_response(URI.parse(url)).body
result = JSON.parse(data)
result["results"]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment