Skip to content

Instantly share code, notes, and snippets.

@0xAether
Created September 14, 2012 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save 0xAether/3724386 to your computer and use it in GitHub Desktop.
Save 0xAether/3724386 to your computer and use it in GitHub Desktop.
A script that scrapes the image hosting website imgur.com
#!/usr/bin/env bash
while [ 1 == 1 ]
do
##########################################################################
url=$(cat /dev/urandom | tr -cd "[:alnum:]" | head -c 5)
curl -f -s http://imgur.com/$url > /dev/null
exitstatus=$?
if [ $exitstatus -eq 0 ]
then
wget $(curl -s http://imgur.com/$url | grep -P '^\t\t\t\t\t\t<img' | sed 's/^.*<img src="\(http:\/\/i.imgur.com\/.....\....\).*$/\1/') >& /dev/null
echo Yup
else
echo Nope
fi
##########################################################################
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment