Skip to content

Instantly share code, notes, and snippets.

@sandaru1
Created April 13, 2011 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sandaru1/918030 to your computer and use it in GitHub Desktop.
Save sandaru1/918030 to your computer and use it in GitHub Desktop.
count tweets
page="`curl 'http://search.twitter.com/search.atom?q=sajje+since%3A2011-04-13&rpp=100'`"
next="test"
all=""
while [ "$next" != "" ]; do
all="$all
`echo "$page" | grep '<name>' | sed 's/<name>\(.*\)<\/name>/\1/' | awk '{print $1}'`"
next=`echo "$page" | grep -o -e '<link type=\"application\/atom+xml\" href\=\"[^\"]*\" rel=\"next\"/>' | sed 's/.*href="\([^"]*\)".*/\1/' | sed 's/\&amp;/\&/g'`
if [ "$next" != "" ]; then
page=`curl $next`
fi
done
echo "$all" | sort | uniq -c | sort -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment