Skip to content

Instantly share code, notes, and snippets.

@andion
Created July 13, 2009 22:28
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 andion/146498 to your computer and use it in GitHub Desktop.
Save andion/146498 to your computer and use it in GitHub Desktop.
module Twitter
class Search
def fetch(force=false)
if @fetch.nil? || force
query = @query.dup
query[:q] = query[:q].join(' ')
query[:format] = 'json' #This line is the hack and whole reason we're monkey-patching at all.
response = self.class.get('http://search.twitter.com/search', :query => query, :format => :json)
@fetch = Mash.new(response)
end
@fetch
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment