-
-
Save matrixfox/30f7059070af638e2149 to your computer and use it in GitHub Desktop.
Flick search api
This file contains hidden or 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
| 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