User Tools

Site Tools


Sidebar

snippets:flickrfetch

What?

My reminders on fetching pictures from flickr, to store them offline, i.e. for display at a monitor. Fetching on linux.

Workflow

  • open a gallery of a user, i.e. https://www.flickr.com/photos/hidesax/
  • open the pictures you like in new tabs, in background, staying on the main page
  • install the firefox “Send Tab URLs” addon, use it to copy all open tabs urls to clipboard
  • in a terminal, store the urls in a file urls.txt
# grep out the flickr urls
grep flickr urls.txt |sort|uniq >urls2

# lets use lynx to get the pictures urls.
# The 2 biggest sizes I see available for the pictures are these:
#  Large 1600 (1600 x 1068)     available at $url/sizes/h
#  Large 2048 (2048 x 1367)     available at $url/sizes/k
for i in $(cat tmpp4); do
  lynx -source $i/sizes/k >>allsources.txt; 
  lynx -source $i/sizes/h >>allsources.txt; 
  echo -n '.'; 
done

# now grep out the photo urls and fetch them
egrep 'img src.*jpg' allsources.txt| \
  sed -e 's,.*src=",,' -e 's,".*,,'|sort|uniq >photourls.txt

# TODO: now for many pictures 2 URLs exist:
#       remove the lower resolution URL.

for i in $(cat photourls.txt); do
  wget $i
done
  • Show your appreciation to the creator, i.e. in buying a wallpaper with his art.
snippets/flickrfetch.txt · Last modified: 2015/08/11 20:32 (external edit)