Skip to content

Instantly share code, notes, and snippets.

@matrixfox
Forked from ck196/flirckr_search.py
Last active February 22, 2016 15:30
Show Gist options
  • Select an option

  • Save matrixfox/30f7059070af638e2149 to your computer and use it in GitHub Desktop.

Select an option

Save matrixfox/30f7059070af638e2149 to your computer and use it in GitHub Desktop.
Flick search api
import flickr_api as f
import re
f.set_keys(api_key = 'xxxxxxxxxxxxxxxxxxxxxxx',
api_secret = 'xxxxxxxxxxx')
auth = f.auth.AuthHandler()
w = f.Walker(f.Photo.search, tags="landscape")
count = 0
for photo in w:
try:
title = photo.title
line = re.sub('[.,!@#$]', '', title)
photo.save("landscape/" + line+" "+photo.id + ".jpg" )
except:
pass
count = count + 1
if count == 110:
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment