Created
July 13, 2009 22:28
-
-
Save andion/146498 to your computer and use it in GitHub Desktop.
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
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