Skip to content

Instantly share code, notes, and snippets.

@ttor
Last active September 9, 2019 12:14
Show Gist options
  • Save ttor/66d7bc84036568e77b36e9c711c66788 to your computer and use it in GitHub Desktop.
Save ttor/66d7bc84036568e77b36e9c711c66788 to your computer and use it in GitHub Desktop.
#/!bin/bash
# This scripts downloads images from flickr from a search results page (flickr.html).
# Sketch to generate flickr.html (in Chrome):
# Search on flickr, select Creative Commons commercial use
# Change tiling to second choice (or adapt "_n" in the processing below)
# In Inspector (ctrl-shift-I), select top <html> element, right-click: copy element
# Paste into flickr.html
# grep image references
cat flickr.html |grep -e '//c.*_n\.jpg' -o > flickr.out
# change resolution to 640xY
perl -pi -e 's/_n/_z/g' flickr.out
# download
for i in `cat flickr.out`; do wget http:$i; done
# cleanup
rm flickr.out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment