| |
- FlickrSyncr
class FlickrSyncr |
|
FlickrSyncr objects sync flickr photos, photo sets, and favorites
lists with the Django backend.
It does not currently sync user meta-data. Photo, PhotoSet, and
FavoriteList objects include some meta-data, but are mostly Django
ManyToManyFields to Photo objects.
This app requires Beej's flickrapi library. Available at:
http://flickrapi.sourceforge.net/ |
|
Methods defined here:
- __init__(self, flickr_key, flickr_secret)
- Construct a new FlickrSyncr object.
Required arguments
flickr_key: a Flickr API key string
flickr_secret: a Flickr secret key as a string
- getExifInfo(self, photo_id)
- Obtain the exif information for a photo_id
Required arguments
photo_id: a flickr photo id as a string
- getExifKey(self, exif_data, key)
- getGeoLocation(self, photo_id)
- Obtain the geographical location information for a photo_id
Required Arguments
photo_id: A flickr photo id
- getPhotoComments(self, photo_id)
- Return a list of all comments.
Each comment is represented as dictionary in this format::
comment = {
'flickr_id': '1132823-183689226-72157594258079061'
'author_nsid': '72875139@N00',
'author': 'Ehudphilip',
'pub_date': datetime.fromtimestamp(int('1156878239')),
'permanent_url': 'http://www.flickr.com/photos/rappensuncle/183689226/#comment72157594258079061',
'comment': 'Great shot!!'
}
Required arguments
photo_id: a flickr photo id as a string
- getPhotoSizes(self, photo_id)
- Return a dictionary of image sizes for a flickr photo.
Required arguments
photo_id: a flickr photo id as a string
- syncAllPhotoSets(self, username)
- Synchronize all photo sets for a flickr user.
Required arguments
username: a flickr username as a string
- syncAllPublic(self, username)
- Synchronize all of a flickr user's photos with Django.
WARNING: This could take a while!
Required arguments
username: a flickr username as a string
- syncPhoto(self, photo_id, refresh=False)
- Synchronize a single flickr photo with Django ORM.
Required Arguments
photo_id: A flickr photo_id
Optional Arguments
refresh: A boolean, if true the Photo will be re-sync'd with flickr
- syncPhotoSet(self, photoset_id, order=None)
- Synchronize a single flickr photo set based on the set id.
Required arguments
photoset_id: a flickr photoset id number as a string
- syncPublicFavorites(self, username)
- Synchronize a flickr user's public favorites.
Required arguments
username: a flickr user name as a string
- syncRecentPhotos(self, username, days=1)
- Synchronize recent public photos from a flickr user.
Required arguments
username: a flickr username as a string
Optional arguments
days: sync photos since this number of days, defaults
to 1 (yesterday)
- user2nsid(self, username)
- Convert a flickr username to an NSID
| |