Skip to content

Instantly share code, notes, and snippets.

@cr1901
Last active August 29, 2015 14:24
Show Gist options
  • Save cr1901/d38786de55403269bfe5 to your computer and use it in GitHub Desktop.
Save cr1901/d38786de55403269bfe5 to your computer and use it in GitHub Desktop.
Tweet Traverse
#!/bin/sh
if [ $# -le 1 ]; then
echo "Please specify a start URL and an output file..."
exit 1
fi
TW_URL=$1
# Yes, I am parsing HTML with regex. I don't care!
while [ ! -z $TW_URL ]; do
TW_URL=`curl -L $TW_URL | grep -m1 "data-expanded-url=" | sed 's%.*\"\(https:[
/.0-9A-Za-z]*\)\".*%\1%g'`
echo $TW_URL
echo $TW_URL >> $2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment