This post is response to a few comments. Firstly, as some people had requested it, I’ve re-written the example from here in Python. I’ll be the first to admit, my Python skills aren’t fantastic, but I tested it against collecting 5k tweets and it appeared to work.
The library can be found at https://github.com/tomkdickinson/Twitter-Search-API-Python. Similar to the Java one, it defines an abstract class you can extend from and write your own custom implementation for what you do with the Tweets on each call to Twitter.
It uses BeautifulSoup for the HTML parsing, and just the standard JSON library to parse the raw response from Twitter.
Secondly, if you want some ideas on the sorts of queries you can do, I would suggest you mess about here: https://twitter.com/search-advanced. Whatever options you select on that and click search, you should be able to copy the query it generates in the search box into the script, and it’ll perform the same search.