Skip to content

Instantly share code, notes, and snippets.

@octagonal octagonal/sorrymoot.sh
Last active Jan 4, 2016

Embed
What would you like to do?
Fast + Simple 4chan Image Downloader
#!/usr/bin/sh
# Every time you use this, Moot sheds a single manly tear. Please use it sparingly if at all.
echo -e "(curl)\t\t Downloading thread"
curl -s http://boards.4chan.org/$1 -o thread.html
echo -e "(grep -Po)\t Finding images "
cat thread.html | grep -Po '(?<=fileThumb" href=")\S+(?=")' > img
echo -e "(sed)\t\t Extracting image links"
sed -i "s/\/\///g" img
echo -e "(mkdir)\t Building directory from argument"
#imgdir=`echo $1 | sed "s/\//-/g"`
mkdir -p $1 2>/dev/null
cd $imgdir
echo -e "(curl)\t\t Downloading images, might take a few seconds"
xargs -n 1 curl -s -O < ../img
echo -e "(rm)\t\t Removing helper files"
rm ../thread.html
rm ../img
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.