Skip to content

Instantly share code, notes, and snippets.

@h3xxx
Forked from 0xAether/imgur.sh
Created May 20, 2016 22:22
Show Gist options
  • Save h3xxx/64b0ce39159fd501838b7d016ec8d188 to your computer and use it in GitHub Desktop.
Save h3xxx/64b0ce39159fd501838b7d016ec8d188 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