I have an Amazon EC2 instance running and use twurl to connect to the Twitter /statuses/filter.json streaming API to collect various sporting tweets.
It all works pretty nicely to be honest, but as a novice I cannot for the life of me figure out how to only run the process for say 1000 tweets, or 5 minutes at a time.
In the Ubuntu terminal, I run the following command:
sudo bash stream.sh
Which calls the bash script containing the following code:
twurl -t -d track=NHL language=en -H stream.twitter.com /1.1/statuses/filter.json > tweets.json
If I manually end the process by pressing CTRL+C, this works perfectly. However, what I would really like is to be able to collect 100 tweets at certain points of the day. Any ideas how I may build this in? I’ve Googled it but have so far come up short…