Last active
August 29, 2015 14:12
-
-
Save stefanschmidt/56c11f811d2243d61031 to your computer and use it in GitHub Desktop.
Scrape images of postings by category from a Wordpress blog
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 | |
# depends on cli-scrape (https://github.com/pthrasher/cli-scrape) | |
# and GNU Parallel (available via Homebrew) | |
for i in `seq 1 100`; | |
do | |
scrape http://foo.com/category/bar/page/$i/ '//img/@src' | | |
sed -En 's/(.*\.)(jpg|png|gif).*/\1\2/p' | | |
parallel --jobs 10 wget {} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment