Skip to content

Instantly share code, notes, and snippets.

@ck196
Created January 27, 2016 04:29
Show Gist options
  • Select an option

  • Save ck196/87de180501c9cc8fdcd5 to your computer and use it in GitHub Desktop.

Select an option

Save ck196/87de180501c9cc8fdcd5 to your computer and use it in GitHub Desktop.

Revisions

  1. ck196 created this gist Jan 27, 2016.
    22 changes: 22 additions & 0 deletions flirckr_search.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    # Using flickr_api to search and download images
    # https://github.com/alexis-mignon/python-flickr-api/wiki/Tutorial

    import flickr_api as f
    f.set_keys(api_key = 'xxxxxxxxxxxxxxxxxxxxxxx',
    api_secret = 'xxxxxxxxxxx')

    auth = f.auth.AuthHandler()

    w = f.Walker(f.Photo.search, tags="sumo")

    count = 0

    for photo in w:
    try:
    photo.save("images/" + photo.id + ".jpg" )
    except:
    pass
    count = count + 1
    if count == 1001:
    break
    #p.save(filename, size_label = 'Medium 640')