Last active
April 1, 2016 03:52
-
-
Save shiflett/e8f2d6e43fe8ae6a603bf7dc4053c34e to your computer and use it in GitHub Desktop.
Scrape a Twitter Profile for 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
#! /bin/bash | |
# Based on https://gist.github.com/scoates/5935435 | |
for u in $*; do | |
echo $u | |
curl -sL http://twitter.com/$u | \ | |
grep 'tweet-text tweet-text' | head -5 | perl -pe 's/.*?>(.*)<\/p>/\1/;s/<.*?>//g' | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To use this, create a new file called
twitter-scrape
(or any name of your choosing), make it executable, then:You can also pass it multiple usernames:
Or, if you prefer, a file full of usernames: