Skip to content

Instantly share code, notes, and snippets.

@wildeyes
Created February 18, 2020 18:18
Show Gist options
  • Save wildeyes/a9546ef3d655152a6b927e29a89f3a55 to your computer and use it in GitHub Desktop.
Save wildeyes/a9546ef3d655152a6b927e29a89f3a55 to your computer and use it in GitHub Desktop.
Download the original wikipedia image on the commandline using pup
# https://github.com/ericchiang/pup
curl -s https://en.wikipedia.org/wiki/File:Great_Wave_off_Kanagawa2.jpg | pup '.internal' 'attr{href}'
# Say you have a list of urls in a file, and you want to download all of them to a directory
cat all-hokusai-views-of-mount-fuji.txt | xargs -I{} curl -s {} | pup '.internal' 'attr{href}' | xargs -I{} wget "http:"\{\} -P hokusai-mount-fiji-collection/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment