Created
April 13, 2011 18:02
-
-
Save sandaru1/918030 to your computer and use it in GitHub Desktop.
count tweets
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
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/\&/\&/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