anoved / WheresThatSat

A Twitter bot that reports current location information about satellites. (Currently on hiatus.)
https://twitter.com/wheresthatsat
MIT License
1 stars 1 forks source link

Perform search as a single OR query #22

Closed anoved closed 12 years ago

anoved commented 12 years ago

In addition to responding to @replies, WheresThatSat can search for and respond to arbitrary tweets containing select satellite names. Currently, it performs a separate query (consuming an API call) for each satellite on the search list. Search could be performed faster - and more efficiently, using only a single API call - by combining the search terms into a single query, joined by OR. The results can then be matched to a satellite similar to how @replies are

https://dev.twitter.com/docs/using-search indicates that queries may be limited by complexity. (Three terms joined by OR does not seem problematic, though.)

That page also points out that search api is rate limited differently than other calls, although limits still apply.

anoved commented 12 years ago

Implemented in ba94f3bd97a2634ecac0f464a292ead7883ec0ca and 1598dae8bd85992af10678ad8ed26fb1398b6425 - search terms are joined into an OR query and submitted as a single request.