Created
November 5, 2012 22:34
-
-
Save mattjj/4020849 to your computer and use it in GitHub Desktop.
twitter scraping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
baseurl='http://search.twitter.com/search.json?q=sandy&rpp=100&since=2012-10-27&until=2012-10-30&callback=?' | |
touch allresults.json | |
curl -s $baseurl | jq '.results | .[]' >> allresults.json | |
maxid=$(<allresults.json jq '.id' | tail -1) | |
while [ $maxid -gt 0 ] | |
do | |
curl -s "${baseurl}&max_id=${maxid}" | jq '.results | .[]' >> allresults.json | |
maxid=$(<allresults.json jq '.id' | tail -1) | |
echo -n '.' | |
sleep 0.1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment