Skip to content

Instantly share code, notes, and snippets.

@rodbegbie
Created October 26, 2009 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodbegbie/218527 to your computer and use it in GitHub Desktop.
Save rodbegbie/218527 to your computer and use it in GitHub Desktop.
Hacky script to remove all the Polar Rose notes now that Flickr has proper persontagging
#!/usr/bin/env python
import flickrapi
import unicodedata
api_key = ""
secret = ''
flickr = flickrapi.FlickrAPI(api_key, secret, token='72157622540482605-f58378ebf472c802')
walker = flickr.walk(user_id='35034351963@N01', per_page=200)
for photo in walker:
info = flickr.photos_getInfo(photo_id=photo.attrib["id"])
title = info.find("photo").find("title").text
title = unicodedata.normalize('NFKD', unicode(title)).encode('ASCII', 'ignore')
print "Working on", title
for note in info.find("photo").find("notes").findall("note"):
text = note.text
text = unicodedata.normalize('NFKD', unicode(text)).encode('ASCII', 'ignore')
print "**** NOTE FOUND", text
if "polarrose.com" in text:
print "********** DELETING! ************ "
flickr.photos_notes_delete(note_id=note.attrib["id"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment