anoved/WheresThatSat

Perform search as a single OR query

Closed this issue · 1 comments

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.

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