Class: Atig::Search
- Inherits:
-
Object
- Object
- Atig::Search
- Defined in:
- lib/atig/search.rb
Instance Method Summary collapse
Instance Method Details
#search(query, options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/atig/search.rb', line 8 def search(query, = {}) search = URI("http://search.twitter.com/search.json") search.path = "/search.json" params = ; [:q] = query search.query = .to_query_str http = Http.new nil req = http.req(:get, search) res = http.http(search, 5, 10).request(req) res = JSON.parse(res.body) rescue Errno::ETIMEDOUT, JSON::ParserError, IOError, Timeout::Error, Errno::ECONNRESET => e @log.error e text end |