com. kelvinluck. flickr. Flickr

Class to provide an interface to the Flickr API

This class in combination with FlickrResponseListener provides a convienient way to interact with the Flickr API from AS 2.  The implementation should abstract away any processing of XML and allow for type checking in the functions you override in FlickrResponseListener.  The idea is to make flash code which interacts with the Flickr API quicker and easier to write.

This code is still beta so feedback is greatfully received :)

Licence

This code and documentation is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.0.  http://creativecommons.org/licenses/by-nc-sa/2.0/

Usage

Very simple usage example -- in the real world you would either subclass FlickrResponseListener to add functionality you required or override the method you were interested in.

import com.kelvinluck.flickr.Flickr;
import com.kelvinluck.flickr.FlickrResponseListener;

var _flickr:Flickr = Flickr.getFlickr();
_flickrResponseListener = new FlickrResponseListener();
_flickr.apiKey = "***";
_flickr.testEcho("one", 2, "free");

This example shows how you would override the method you were interested in:

import com.kelvinluck.flickr.Flickr;
import com.kelvinluck.flickr.FlickrResponseListener;

var _flickr:Flickr = Flickr.getFlickr();
_flickrResponseListener = new FlickrResponseListener();
_flickrResponseListener.onTestEcho = function(params:Object) {
// do stuff
}
_flickr.apiKey = "***";
_flickr.testEcho("one", 2, "free");

See Also

FlickrResponseListener

http://www.flickr.com/services/api/

Version

0.3.0

Author

Kelvin Luck < kelvin at kelvinluck dot com >

Project Website

http://kelvinluck.com- /projects- /flashr-a-flickr-api-wrapper-for-flash

Summary
Class to provide an interface to the Flickr API
Your Flickr API Key.
The place for all API calls to connect to.
The base path you go to when you want to authenticate on flickr.com
The API is already waiting for the response to a method call so cannot make another call
Could not connect to the server (e.g.
The XML returned by the server wasn’t in a &lt;rsp /&gt; tag.
The user wasn’t logged in and tried to access a method that requires authentication (returned from flickr.com)
The API key sent to flickr was invalid (returned from flickr.com)
There was no errors and valid XML was returned.
A constant representing permissions for nobody.
A constant representing permissions for friends and family.
A constant representing permissions for contacts.
A constant representing permissions for everybody.
Private variable to store this app’s shared secret for use with the authentication API.
Private variable which stores the token generated by a successfull authorisation.
Private variable which is used to store the frob which is used for the first part of the authentication process.
A variable describing the permissions the currently auth’d user has within this app.
A Person object for the currently auth’d user (if there is one).
Constructor - as this class implements the Singleton pattern do not call directly but rather access through Flickr.getFlickr.
Use to set the value of the shared secret before any calls to methods like authLogin or authCheckToken
Pops open a login window so that the user can authenticate with the flickr.com website.
Calls flickr.auth.getFrob to get a frob to be used during authentication.
Calls flickr.auth.getToken to get the auth token for the given frob, if one has been attached.
Calls flickr.auth.checkToken to get the credentials attached to an authentication token.
Simple function which forgets the information that was making this user be logged in.
Internal function which generates the relevant link and pops open the login window on flickr.com.
Internal, private function which is used to generate the api_sig used to sign a call.
Calls flickr.contacts.getList to get a list of contacts for the calling user.
Calls flickr.contacts.getPublicList to get a list of contacts a user.
Calls flickr.favorites.add to add a photo to a user’s favorites list.
Calls flickr.favorites.getList to get a list of the user’s favorite photos.
Calls flickr.favorites.getPublicList to get a list of favorite public photos for the given user.
Calls flickr.favorites.remove to remove a photo from a user’s favorites list.
Add a photo to a group’s pool.
Gets next and previous photos for a photo in a group pool.
Gets a list of groups to which you can add photos.
Gets a list of pool photos for a given group, based on the permissions of the group and the user logged in (if any).
Remove a photo from a group pool.
Calls flickr.people.findByEmail to get a user’s NSID, given their email address.
Calls flickr.people.findByUsername to get a user’s NSID, given their username.
Calls flickr.people.getInfo to get information about a user.
Calls flickr.people.getPublicGroups to get the list of public groups a user is a member of.
Calls flickr.people.getPublicPhotos to get a list of public photos for the given user.
Calls flickr.people.getUploadStatus to get information for the calling user related to photo uploads.
Calls flickr.photos.addTags to add tags to a given photo.
Returns all visble sets and pools the photo belongs to.
Calls flickr.photos.getContactsPhotos to fetch a list of recent photos from the calling users’ contacts.
Calls flickr.photos.getContactsPublicPhotos to fetch a list of recent public photos from a users’ contacts.
Calls flickr.photos.getContext to return next and previous photos for a photo in a photostream.
Calls flickr.photos.getCounts to get a list of photo counts for the given date ranges for the calling user.
Calls flickr.photos.getExif to return a list of EXIF/TIFF/GPS tags for a given photo.
Calls flickr.photos.getInfo to get information about a photo..
Calls flickr.photos.getNotInSet to get a list of your photos that are not part of any sets.
Calls flickr.photos.getPerms to get permissions for a photo.
Calls flickr.photos.getRecent to get a list of the latest public photos uploaded to flickr.
Calls flickr.photos.getRecent to get the available sizes for a photo.
Calls flickr.photos.getUntagged to get a list of your photos with no tags.
Calls flickr.photos.removeTag to remove a tag from a photo.
Calls flickr.photos.search to get a list of photos matching some criteria.
Calls flickr.photos.setDates to set one or both of the dates for a photo..
Calls flickr.photos.setMeta to set the meta information for a photo.
Calls flickr.photos.setPerms to set permissions for a photo..
Calls flickr.photos.setTags to set the tags for a photo.
Add a photo to the end of an existing photoset.
Create a new photoset for the calling user.
Delete a photoset.
Modify the meta-data for a photoset.
Modify the photos in a photoset.
Returns next and previous photos for a photo in a set.
Gets information about a photoset.
Gets the photosets belonging to the specified user.
Get the list of photos in a set.
Set the order of photosets for the calling user.
Remove a photo from a photoset.
Calls flickr.tags.getListPhoto to get the tag list for a given photo.
Calls flickr.tags.getListUser to get the tag list for a given user (or the currently logged in user).
Calls flickr.tags.getListUserPopular to get the popular tags for a given user (or the currently logged in user).
Calls flickr.tags.getRelated to get a list of tags ‘related’ to the given tag, based on clustered usage analysis.
Calls flickr.test.echo - forwards any arguments on to the Flickr API
Calls flickr.test.login - A testing method which checks if the caller is logged in then returns their username.
Used to call a method on the flickr API.
Called internally on recepit of a response from a request to the <REST_ENDPOINT>.
Internal function used to convert a list of arguments into a querystring for use in a URL for a call to flickr.com.
Private internal function used to avoid duplicate code to parse “the standard photo list xml”
Private internal function used to avoid duplicate code when parsing the standard photoset XML
Private internal function used to avoid duplicate code when parsing the standard context XML
Returns a reference to the Flickr instance - if none exists yet then creates one and returns a reference to that.

apiKey

private var _apiKey: String

Your Flickr API Key.  None of the method calls will work without this.

_REST_ENDPOINT

private var _REST_ENDPOINT: String

The place for all API calls to connect to.  The default value of connecting directly to the flickr.com server will only work if a relevant entry is added to their crossdomain.xml file otherwise set the value to the location of a proxy script on your server.

_AUTH_ENDPOINT

private var _AUTH_ENDPOINT: String

The base path you go to when you want to authenticate on flickr.com

STATUS_BUSY

public static var STATUS_BUSY: Number

The API is already waiting for the response to a method call so cannot make another call

STATUS_ERROR_CONNECTING

public static var STATUS_ERROR_CONNECTING: Number

Could not connect to the server (e.g. no internet connection, server down, security restrictions)

STATUS_INVALID_XML

public static var STATUS_INVALID_XML: Number

The XML returned by the server wasn’t in a &lt;rsp /&gt; tag.

STATUS_USER_NOT_LOGGED_IN

public static var STATUS_USER_NOT_LOGGED_IN: Number

The user wasn’t logged in and tried to access a method that requires authentication (returned from flickr.com)

STATUS_INVALID_API_KEY

public static var STATUS_INVALID_API_KEY: Number

The API key sent to flickr was invalid (returned from flickr.com)

STATUS_OK

public static var STATUS_OK: Number

There was no errors and valid XML was returned.

PERM_NOBODY

public static var PERM_NOBODY: Number

A constant representing permissions for nobody.

See Also

photosSetPerms

PERM_FRIENDS

public static var PERM_FRIENDS: Number

A constant representing permissions for friends and family.

See Also

photosSetPerms

PERM_CONTACTS

public static var PERM_CONTACTS: Number

A constant representing permissions for contacts.

See Also

photosSetPerms

PERM_EVERYBODY

public static var PERM_EVERYBODY: Number

A constant representing permissions for everybody.

See Also

photosSetPerms

_secret

private var _secret: String

Private variable to store this app’s shared secret for use with the authentication API.

See Also

authLogin

http://www.flickr.com/services/api/auth.spec.html

http://www.flickr.com- /services- /api- /registered_keys.gne

_authToken

private var _authToken: String

Private variable which stores the token generated by a successfull authorisation.

_authFrob

private var _authFrob: String

Private variable which is used to store the frob which is used for the first part of the authentication process.

authPerms

var authPerms: String

A variable describing the permissions the currently auth’d user has within this app.  It will be “none” until the user has been logged in and then will become “read”, “write” or “delete”.  You can check whether authPerms == “none” if you want to find out if the user is currently logged in before checking who they are with authUser

See Also

authLogin

authUser

authUser

var authUser: Person

A Person object for the currently auth’d user (if there is one).  Empty if there is no currently auth’d user.

See Also

authLogin

authPerms

Flickr

private function Flickr()

Constructor - as this class implements the Singleton pattern do not call directly but rather access through Flickr.getFlickr.

authSetSecret

public function authSetSecret(secret: String)

Use to set the value of the shared secret before any calls to methods like authLogin or authCheckToken

Parameters

secretYour applications shared secret.

See Also

authLogin

authCheckToken

http://www.flickr.com/services/api/auth.spec.html

http://www.flickr.com- /services- /api- /auth.howto.desktop.html

http://www.flickr.com- /services- /api- /registered_keys.gne

authLogin

public function authLogin(perms: String)

Pops open a login window so that the user can authenticate with the flickr.com website.  The user authenticates using the “Non-web based app” method as described in section 9.2 of the auth spec.

The end effect of calling this function is that a window is opened with the relevant login / authenticate stuff on flickr.com.  It is the responsibility of the user of this library to pop up a dialog box saying words to the effect of:

”This program requires your authentication before it can read/write/delete your photos on flickr.com.  Please complete the authorisation process in the window which has popped up and then press the CONTINUE button below”

The CONTINUE button needs to call authGetToken which does the final stage of logging the user in.

Parameters

permsA desired level of permission for actions which the application wants to perform on behalf of the user.  “read”, “write” or “delete”.

See Also

authGetToken

http://www.flickr.com/services/api/auth.spec.html

http://www.flickr.com- /services- /api- /auth.howto.desktop.html

http://www.flickr.com- /services- /api- /registered_keys.gne

authGetFrob

public function authGetFrob(authIsLoggingIn: Boolean)

Calls flickr.auth.getFrob to get a frob to be used during authentication.  In most cases you would not call this method directly and would instead use authLogin.

Parameters

authIsLoggingInSet to true internally so that authLogin doesn’t need to bother a FlickrResponseListener.  If you call the function then leave this empty or put in the default (false).

See Also

authLogin

FlickrResponseListener.onAuthGetFrob

http://flickr.com- /services- /api- /flickr.auth.getFrob.html

authGetToken

public function authGetToken()

Calls flickr.auth.getToken to get the auth token for the given frob, if one has been attached.

Should be called after the user has pressed CONTINUE on the status window you opened when calling authLogin.

If a valid token is returned (e.g. if the frob was correct and valid) then the user is logged in for all further API calls from this session and FlickrResponseListener.onAuthCheckToken will be fired.  If there is a problem then FlickrResponseListener.onError is fired.

See Also

authLogin

FlickrResponseListener.onAuthCheckToken

http://www.flickr.com- /services- /api- /flickr.auth.getToken.html

authCheckToken

public function authCheckToken(authToken: String)

Calls flickr.auth.checkToken to get the credentials attached to an authentication token.  You can use this to log in if you have auth’d an app in a previous session and saved the token e.g. in a SharedObject.  If the token is still valid, the user will become logged in and FlickrResponseListener.onAuthCheckToken will be fired.  If the token is invalid then FlickrResponseListener.onError will be fired.

Parameters

authTokenThe authentication token to check.

See Also

FlickrResponseListener.onAuthCheckToken

http://www.flickr.com- /services- /api- /flickr.auth.checkToken.html

authLogout

public function authLogout()

Simple function which forgets the information that was making this user be logged in.  The app will remain authenticated against flickr.com until the user visits http://www.flickr.com/services/auth/list.gne but the app will have to reapply for frob and then a token to use this authentication...

_authOpenLogin

private function _authOpenLogin()

Internal function which generates the relevant link and pops open the login window on flickr.com.  Triggered when a frob (necessary to generate the link) is returned from flickr.auth.getFrob.

See Also

http://www.flickr.com- /services- /api- /flickr.auth.getFrob.html

http://www.flickr.com/services/api/auth.spec.html

http://www.flickr.com- /services- /api- /auth.howto.desktop.html

http://www.flickr.com- /services- /api- /registered_keys.gne

_authSignCall

private function _authSignCall(urlArguments: Object):String

Internal, private function which is used to generate the api_sig used to sign a call.

Parameters

urlArgumentsAn Object containing name/value pairs which describe all of the arguments on the URL.

See Also

http://www.flickr.com/services/api/auth.spec.html

http://www.flickr.com- /services- /api- /auth.howto.desktop.html

http://www.flickr.com- /services- /api- /registered_keys.gne

contactsGetList

public function contactsGetList(filter: String)

Calls flickr.contacts.getList to get a list of contacts for the calling user.

Parameters

filterAn optional filter of the results.  One of “friends”, “friends”, “both” or “neither”

See Also

FlickrResponseListener.onContactsGetList

http://flickr.com- /services- /api- /flickr.contacts.getList.html

contactsGetPublicList

public function contactsGetPublicList(nsid: String)

Calls flickr.contacts.getPublicList to get a list of contacts a user.

Parameters

nsidThe nsid of the user whose contacts you want to get.

See Also

FlickrResponseListener.onContactsGetPublicList

http://flickr.com- /services- /api- /flickr.contacts.getPublicList.html

favoritesAdd

public function favoritesAdd(photoId: Number)

Calls flickr.favorites.add to add a photo to a user’s favorites list.

Parameters

photoIdThe id of the photo you want to add.

See Also

FlickrResponseListener.onFavoritesAdd

http://www.flickr.com- /services- /api- /flickr.favorites.add.html

favoritesGetList

public function favoritesGetList(userId: String,
extras: String,
perPage: Number,
page: Number)

Calls flickr.favorites.getList to get a list of the user’s favorite photos.

Parameters

userIdThe id of the user to get favourites for [Optional: default=logged in user]
extrasA comma-delimited list of extra information to fetch for each returned record.  Currently supported fields are: license, date_upload, date_taken, owner_name, icon_server, original_format.
perPageThe number of results to get per page [Optional: default=100]
pageThe page of results to get [Optional: default=1]

See Also

FlickrResponseListener.onFavoritesGetList

http://www.flickr.com- /services- /api- /flickr.favorites.getList.html

favoritesGetPublicList

public function favoritesGetPublicList(userId: String,
extras: String,
perPage: Number,
page: Number)

Calls flickr.favorites.getPublicList to get a list of favorite public photos for the given user.

Parameters

userIdThe id of the user to get favourites for
extrasA comma-delimited list of extra information to fetch for each returned record.  Currently supported fields are: license, date_upload, date_taken, owner_name, icon_server.
perPageThe number of results to get per page [Optional: default=100]
pageThe page of results to get [Optional: default=1]

See Also

FlickrResponseListener.onFavoritesGetPublicList

http://www.flickr.com- /services- /api- /flickr.favorites.getPublicList.html

favoritesRemove

public function favoritesRemove(photoId: Number)

Calls flickr.favorites.remove to remove a photo from a user’s favorites list.

Parameters

photoIdThe id of the photo you want to add.

See Also

FlickrResponseListener.onFavoritesRemove

http://www.flickr.com- /services- /api- /flickr.favorites.remove.html

groupsPoolsAdd

function groupsPoolsAdd(photoId: Number,
groupId: String)

Add a photo to a group’s pool.

Parameters

photoIdThe id of the photo to add to the group pool.  The photo must belong to the calling user.
groupIdThe NSID of the group who’s pool the photo is to be added to.

See Also

FlickrResponseListener.onGroupsPoolsAdd

http://www.flickr.com- /services- /api- /flickr.groups.pools.add.html

groupsPoolsGetContext

function groupsPoolsGetContext(photoId: Number,
groupId: String)

Gets next and previous photos for a photo in a group pool.

Parameters

photoIdThe id of the photo to fetch the context for.
groupIdThe nsid of the group who’s pool to fetch the photo’s context for.

See Also

FlickrResponseListener.onGroupsPoolsAdd

http://www.flickr.com- /services- /api- /flickr.groups.pools.add.html

groupsPoolsGetGroups

function groupsPoolsGetGroups()

Gets a list of groups to which you can add photos.

See Also

FlickrResponseListener.onGroupsPoolsGetGroups

http://www.flickr.com- /services- /api- /flickr.groups.pools.getGroups.html

groupsPoolsGetPhotos

function groupsPoolsGetPhotos(groupId: String,
tags: String,
extras: String,
perPage: Number,
page: Number,
userId: String)

Gets a list of pool photos for a given group, based on the permissions of the group and the user logged in (if any).

Parameters

groupIdThe id of the group who’s pool you which to get the photo list for.
tagsA tag to filter the pool with.  At the moment only one tag at a time is supported.
extrasA comma-delimited list of extra information to fetch for each returned record.  Currently supported fields are: license, date_upload, date_taken, owner_name, icon_server, original_format.
perPageThe number of photos to return per page.  [Optional: default=100]
pageThe page of results to return.  [Optional: default=1]
userIdThe nsid of a user.  Specifiying this parameter will retrieve for you only those photos that the user has contributed to the group pool.  [Optional]

See Also

FlickrResponseListener.onGroupsPoolsGetPhotos

http://www.flickr.com- /services- /api- /flickr.groups.pools.getPhotos.html

groupsPoolsRemove

function groupsPoolsRemove(photoId: Number,
groupId: String)

Remove a photo from a group pool.

Parameters

photoIdThe id of the photo to remove from the group pool.  The photo must either be owned by the calling user of the calling user must be an administrator of the group
groupIdThe NSID of the group who’s pool the photo is to removed from.

peopleFindByEmail

function peopleFindByEmail(email: String)

Calls flickr.people.findByEmail to get a user’s NSID, given their email address.

Parameters

emailThe email address of the person whose nsid you want

See Also

FlickrResponseListener.onPeopleFindByEmail

http://flickr.com- /services- /api- /flickr.people.findByEmail.html

peopleFindByUsername

function peopleFindByUsername(username: String)

Calls flickr.people.findByUsername to get a user’s NSID, given their username.

Parameters

usernameThe username of the person whose nsid you want

See Also

FlickrResponseListener.onPeopleFindByUsername

http://flickr.com- /services- /api- /flickr.people.findByUsername.html

peopleGetInfo

function peopleGetInfo(nsid: String)

Calls flickr.people.getInfo to get information about a user.

Parameters

nsidThe nsid of the user you want information about.

See Also

FlickrResponseListener.onPeopleGetInfo

http://flickr.com- /services- /api- /flickr.people.getInfo.html

peopleGetPublicGroups

function peopleGetPublicGroups(nsid: String)

Calls flickr.people.getPublicGroups to get the list of public groups a user is a member of.

Parameters

nsidThe nsid of the user whose groups you want to know about.

See Also

FlickrResponseListener.onPeopleGetPublicGroups

http://www.flickr.com- /services- /api- /flickr.people.getPublicGroups.html

peopleGetPublicPhotos

function peopleGetPublicPhotos(nsid: String,
extras: String,
perPage: Number,
page: Number)

Calls flickr.people.getPublicPhotos to get a list of public photos for the given user.

Parameters

nsidThe nsid of the user whose photos you want to know about.
extrasA comma-delimited list of extra information to fetch for each returned record.  Currently supported fields are: license, date_upload, date_taken, owner_name, icon_server, original_format.
perPageThe number of photos to return per page.  [Optional: default=100]
pageThe page of results to return.  [Optional: default=1]

See Also

FlickrResponseListener.onPeopleGetPublicPhotos

http://flickr.com- /services- /api- /flickr.people.getPublicPhotos.html

peopleGetUploadStatus

function peopleGetUploadStatus()

Calls flickr.people.getUploadStatus to get information for the calling user related to photo uploads.

See Also

FlickrResponseListener.onPeopleGetUploadStatus

http://flickr.com- /services- /api- /flickr.people.getUploadStatus.html

photosAddTags

function photosAddTags (photoId: Number,
tags: String)

Calls flickr.photos.addTags to add tags to a given photo.

Parameters

photoIdThe id of the photo to add tags to.
tagsThe tags to add to the photo.

See Also

FlickrResponseListener.onPhotosAddTags

http://flickr.com- /services- /api- /flickr.photos.addTags.html

photosGetAllContexts

function photosGetAllContexts(photoId: Number)

Returns all visble sets and pools the photo belongs to.

Parameters

photoIdThe photo to return information for.

See Also

FlickrResponseListener.onPhotosGetAllContexts

http://www.flickr.com- /services- /api- /flickr.photos.getAllContexts.html

photosGetContactsPhotos

function photosGetContactsPhotos (count: Number,
justFriends: Number,
singlePhoto: Number,
includeSelf: Number,
extras: String)

Calls flickr.photos.getContactsPhotos to fetch a list of recent photos from the calling users’ contacts.

Parameters

countNumber of photos to return.  Defaults to 10, maximum 50.  This is only used if single_photo is not passed.
justFriendsset as 1 to only show photos from friends and family (excluding regular contacts).  [Optional: default=0].
singlePhotoOnly fetch one photo (the latest) per contact, instead of all photos in chronological order [Optional: default=0].
includeSelfSet to 1 to include photos from the calling user.  [Optional: default=0].
extrasA comma-delimited list of extra information to fetch for each returned record.  Currently supported fields are: license, date_upload, date_taken, owner_name, icon_server, original_format.

See Also

FlickrResponseListener.onPhotosGetContactsPhotos

http://flickr.com- /services- /api- /flickr.photos.getContactsPhotos.html

photosGetContactsPublicPhotos

function photosGetContactsPublicPhotos (nsid: String,
count: Number,
justFriends: Number,
singlePhoto: Number,
includeSelf: Number,
extras: String)

Calls flickr.photos.getContactsPublicPhotos to fetch a list of recent public photos from a users’ contacts.

Parameters

nsidThe NSID of the user to fetch photos for.
countNumber of photos to return.  Defaults to 10, maximum 50.  This is only used if single_photo is not passed.  [Optional: default=10].
justFriendsset as 1 to only show photos from friends and family (excluding regular contacts).  [Optional: default=0].
singlePhotoOnly fetch one photo (the latest) per contact, instead of all photos in chronological order [Optional: default=0].
includeSelfSet to 1 to include photos from the calling user.  [Optional: default=0].
extrasA comma-delimited list of extra information to fetch for each returned record.  Currently supported fields are: license, date_upload, date_taken, owner_name, icon_server, original_format.

See Also

FlickrResponseListener.onPhotosGetContactsPublicPhotos

http://www.flickr.com- /services- /api- /flickr.photos.getContactsPublicPhotos.html

photosGetContext

function photosGetContext (photoId: Number)

Calls flickr.photos.getContext to return next and previous photos for a photo in a photostream.

Parameters

photoIdThe id of the photo to fetch the context for.

See Also

FlickrResponseListener.onPhotosGetContext

http://www.flickr.com- /services- /api- /flickr.photos.getContext.html

photosGetCounts

function photosGetCounts (dates: String,
takenDates: String)

Calls flickr.photos.getCounts to get a list of photo counts for the given date ranges for the calling user.

Parameters

datesA comma delimited list of unix timestamps denoting the periods to return counts for.  They should be specified smallest first.  [Optional: if not present then takenDates used instead.
takenDatesA comma delimited list of mysql datetimes denoting the periods to return counts for.  They should be specified smallest first.  [Optional: if not present then dates used instead.

Note

  • The dates parameter is passed as UNIX Timestamps while the takenDates parameter is passed as MySQL Timestamps (e.g.  2005-03-21).
  • If you want to pass takenDates then pass “” (empty string) or undefined as the value of dates.

TODO

Should we change this method to accept Arrays of Date Objects rather than comma delimited Strings?  Then we could sort it making order unimportant and could abstract away the fact that Flickr stores dates uploaded and dates taken in different formats.  Maybe it would be better if the method’s arguments were dates (an Array of Date Objects) and type (Flickr.DATES_UPLOADED or Flickr.DATES_TAKEN)?

See Also

FlickrResponseListener.onPhotosGetCounts

http://www.flickr.com- /services- /api- /flickr.photos.getCounts.html

photosGetExif

function photosGetExif (photoId: Number,
secret: String)

Calls flickr.photos.getExif to return a list of EXIF/TIFF/GPS tags for a given photo.

Parameters

photoIdThe id of the photo to fetch the context for.
secretThe secret for the photo.  If the correct secret is passed then permissions checking is skipped.  This enables the ‘sharing’ of individual photos by passing around the id and secret.

See Also

FlickrResponseListener.onPhotosGetExif

ExifData

http://www.flickr.com- /services- /api- /flickr.photos.getExif.html

photosGetInfo

function photosGetInfo (photoId: Number,
secret: String)

Calls flickr.photos.getInfo to get information about a photo..

Parameters

photoIdThe id of the photo to fetch the context for.
secretThe secret for the photo.  If the correct secret is passed then permissions checking is skipped.  This enables the ‘sharing’ of individual photos by passing around the id and secret.

See Also

FlickrResponseListener.onPhotosGetInfo

http://www.flickr.com- /services- /api- /flickr.photos.getInfo.html

photosGetNotInSet

function photosGetNotInSet (extras: String,
perPage: Number,
page: Number)

Calls flickr.photos.getNotInSet to get a list of your photos that are not part of any sets.

Parameters

extrasA comma-delimited list of extra information to fetch for each returned record.  Currently supported fields are: license, date_upload, date_taken, owner_name, icon_server, original_format
perPageThe number of photos to return per page.  [Optional: default=100]
pageThe page of results to return.  [Optional: default=1]

See Also

FlickrResponseListener.onPhotosGetNotInSet

http://www.flickr.com- /services- /api- /flickr.photos.getNotInSet.html

photosGetPerms

function photosGetPerms (photoId: Number)

Calls flickr.photos.getPerms to get permissions for a photo.

Parameters

photoIdThe id of the photo whose permissions you want

See Also

FlickrResponseListener.onPhotosGetNotInSet

http://www.flickr.com- /services- /api- /flickr.photos.getPerms.html

photosGetRecent

function photosGetRecent (extras: String,
perPage: Number,
page: Number)

Calls flickr.photos.getRecent to get a list of the latest public photos uploaded to flickr.

Parameters

extrasA comma-delimited list of extra information to fetch for each returned record.  Currently supported fields are: license, date_upload, date_taken, owner_name, icon_server, original_format
perPageThe number of photos to return per page.  [Optional: default=100]
pageThe page of results to return.  [Optional: default=1]

See Also

FlickrResponseListener.onPhotosGetRecent

http://www.flickr.com- /services- /api- /flickr.photos.getRecent.html

photosGetSizes

function photosGetSizes (photoId: Number)

Calls flickr.photos.getRecent to get the available sizes for a photo.

Parameters

photoIdThe id of the photo to fetch size information for.

See Also

FlickrResponseListener.onPhotosGetSizes

http://www.flickr.com- /services- /api- /flickr.photos.getSizes.html

photosGetUntagged

function photosGetUntagged (extras: String,
perPage: Number,
page: Number)

Calls flickr.photos.getUntagged to get a list of your photos with no tags.

Parameters

extrasA comma-delimited list of extra information to fetch for each returned record.  Currently supported fields are: license, date_upload, date_taken, owner_name, icon_server
perPageThe number of photos to return per page.  [Optional: default=100]
pageThe page of results to return.  [Optional: default=1]

See Also

FlickrResponseListener.onPhotosGetUntagged

http://www.flickr.com- /services- /api- /flickr.photos.getUntagged.html

photosRemoveTag

function photosRemoveTag (tagId: Number)

Calls flickr.photos.removeTag to remove a tag from a photo.

Parameters

tagIdThe tag to remove from the photo.  This parameter should contain a tag id, as returned by photosGetInfo.

See Also

FlickrResponseListener.onPhotosRemoveTag

http://www.flickr.com- /services- /api- /flickr.photos.removeTag.html

photosSearch

function photosSearch (params)

Calls flickr.photos.search to get a list of photos matching some criteria.

You pass an object with one or many of the following attributes...

Attributes

user_idThe NSID of the user who’s photo to search.  If this parameter isn’t passed then everybody’s public photos will be searched.
tagsA comma-delimited list of tags.  Photos with one or more of the tags listed will be returned.
tag_modeEither ‘any’ for an OR combination of tags, or ‘all’ for an AND combination.  Defaults to ‘any’ if not specified.
textA free text search.  Photos who’s title, description or tags contain the text will be returned.
min_upload_dateMinimum upload date.  Photos with an upload date greater than or equal to this value will be returned.  The date should be in the form of a UNIX timestamp.
max_upload_dateMaximum upload date.  Photos with an upload date less than or equal to this value will be returned.  The date should be in the form of a UNIX timestamp.
min_taken_dateMinimum taken date.  Photos with an taken date greater than or equal to this value will be returned.  The date should be in the form of a MySQL datetime.
max_taken_dateMaximum taken date.  Photos with an taken date less than or equal to this value will be returned.  The date should be in the form of a MySQL datetime.
licenseThe license id for photos.
extrasA comma-delimited list of extra information to fetch for each returned record.  Currently supported fields are: license, date_upload, date_taken, owner_name, icon_server, original_format
per_pageNumber of photos to return per page.  If this argument is ommited, it defaults to 100.  The maximum allowed value is 500.
pageThe page of results to return.  If this argument is ommited, it defaults to 1.
sortThe order in which to sort returned photos.  Deafults to date-posted-desc.  The possible values are: date-posted-asc, date-posted-desc, date-taken-asc , date-taken-desc, interestingness-desc and interestingness-asc

TODO

Should probably change it to accept dates as Date Objects...  Then you wouldn’t have to worry about what type of date flickr expects for the different arguments.

See Also

FlickrResponseListener.onPhotosSearch

http://www.flickr.com- /services- /api- /flickr.photos.search.html

photosSetDates

function photosSetDates (photoId: Number,
datePosted: Date,
dateTaken: Date,
dateTakenGran: Number)

Calls flickr.photos.setDates to set one or both of the dates for a photo..

All parameters are optional but you must provide either dateTaken or datePosted (or both if you like).

Dates are passed as Flash Date Objects so you don’t need to worry about the fact that flickr uses two different formats to represent it’s dates...

Parameters

photoIdThe id of the photo to edit dates for.
datePostedThe Date the photo was uploaded to flickr.
dateTakenThe Date the photo was taken.
dateTakenGranThe granularity of the date the photo was taken.

See Also

FlickrResponseListener.onPhotosSetDates

http://flickr.com- /services- /api- /flickr.photos.setDates.html

http://flickr.com/services/api/misc.dates.html

photosSetMeta

function photosSetMeta (photoId: Number,
title: String,
description: String)

Calls flickr.photos.setMeta to set the meta information for a photo.

Parameters

photoIdThe id of the photo to edit dates for.
titleThe title for the photo.
descriptionThe description for the photo.

See Also

FlickrResponseListener.onPhotosSetMeta

http://flickr.com- /services- /api- /flickr.photos.setMeta.html

photosSetPerms

function photosSetPerms (photoId: Number,
isPublic: Number,
isFriend: Number,
isFamily: Number,
permComment: Number,
permAddMeta: Number)

Calls flickr.photos.setPerms to set permissions for a photo..

Parameters

photoIdThe id of the photo to set permissions for.
isPublic1 to set the photo to public, 0 to set it to private.
isFriend1 to make the photo visible to friends when private, 0 to not.
isFamily1 to make the photo visible to family when private, 0 to not.
permCommentwho can add comments to the photo and it’s notes.  See Flickr.PERM_* for options.
permAddMetawho can add notes and tags to the photo.  See Flickr.PERM_* for options.

See Also

Flickr.PERM_NOBODY

Flickr.PERM_FRIENDS

Flickr.PERM_CONTACTS

Flickr.PERM_EVERYBODY

FlickrResponseListener.onPhotosSetMeta

http://flickr.com- /services- /api- /flickr.photos.setMeta.html

photosSetTags

function photosSetTags (photoId: Number,
tags: String)

Calls flickr.photos.setTags to set the tags for a photo.

Parameters

photoIdThe id of the photo to edit dates for.
tagsAll tags for the photo (as a single space-delimited string).

See Also

FlickrResponseListener.onPhotosSetTags

Photo.setTags - There are some problems listed here...

http://flickr.com- /services- /api- /flickr.photos.setTags.html

photosetsAddPhoto

function photosetsAddPhoto(photosetId: Number,
photoId: Number)

Add a photo to the end of an existing photoset.

Parameters

photosetIdThe id of the photoset to add a photo to.
photoIdThe id of the photo to add to the set.

See Also

FlickrResponseListener.onPhotosetsAddPhoto

http://www.flickr.com- /services- /api- /flickr.photosets.addPhoto.html

photosetsCreate

function photosetsCreate(title: String,
description: String,
primaryPhotoId: Number)

Create a new photoset for the calling user.

Parameters

titleA title for the photoset.
descriptionA description of the photoset.  May contain limited html.
primaryPhotoIdThe id of the Photo to represent this set.  The photo must belong to the calling user.

See Also

FlickrResponseListener.onPhotosetsCreate

http://www.flickr.com- /services- /api- /flickr.photosets.create.html

photosetsDelete

function photosetsDelete(photosetId: Number)

Delete a photoset.

Parameters

photosetIdThe id of the Photoset to delete.  It must be owned by the calling user.

See Also

FlickrResponseListener.onPhotosetsDelete

http://www.flickr.com- /services- /api- /flickr.photosets.delete.html

photosetsEditMeta

function photosetsEditMeta(photosetId: Number,
title: String,
description: String)

Modify the meta-data for a photoset.

Parameters

photosetIdThe id of the Photoset to modify.
titleThe new title for the photoset.
descriptionA description of the photoset.  May contain limited html.

See Also

FlickrResponseListener.onPhotosetsEditMeta

http://www.flickr.com- /services- /api- /flickr.photosets.editMeta.html

photosetsEditPhotos

function photosetsEditPhotos(photosetId: Number,
primaryPhotoId: Number,
photoIds: Array)

Modify the photos in a photoset.  Use this method to add, remove and re-order photos.

Parameters

photosetIdThe id of the photoset to modify.  The photoset must belong to the calling user.
primaryPhotoIdThe id of the photo to use as the ‘primary’ photo for the set.  This id must also be passed along in photo_ids list argument.
photoIdsA comma-delimited list of photo ids to include in the set.  They will appear in the set in the order sent.  This list must contain the primary photo id.  All photos must belong to the owner of the set.  This list of photos replaces the existing list.  Call photosetsAddPhoto to append a photo to a set.

See Also

FlickrResponseListener.onPhotosetsEditPhotos

http://www.flickr.com- /services- /api- /flickr.photosets.editPhotos.html

photosetsGetContext

function photosetsGetContext(photoId: Number,
photosetId: Number)

Returns next and previous photos for a photo in a set.

Parameters

photoIdThe id of the Photo to fetch the context for.
photosetIdThe id of the Photoset for which to fetch the Photo’s context.

See Also

FlickrResponseListener.onPhotosetsGetContext

http://www.flickr.com- /services- /api- /flickr.photosets.getContext.html

photosetsGetInfo

function photosetsGetInfo(photosetId: Number)

Gets information about a photoset.

Parameters

photosetIdThe id of the Photoset to fetch information for.

See Also

FlickrResponseListener.onPhotosetsGetInfo

http://www.flickr.com- /services- /api- /flickr.photosets.getInfo.html

photosetsGetList

function photosetsGetList(userId: String)

Gets the photosets belonging to the specified user.

Parameters

userIdThe nsid of the Person to get a photoset list for.  If none is specified, the calling user is assumed.

See Also

FlickrResponseListener.onPhotosetsGetList

http://www.flickr.com- /services- /api- /flickr.photosets.getList.html

photosetsGetPhotos

function photosetsGetPhotos(photosetId: Number,
extras: String)

Get the list of photos in a set.

Parameters

photosetIdThe id of the Photoset to return the photos for.
extrasA comma-delimited list of extra information to fetch for each returned record.  Currently supported fields are: license, date_upload, date_taken, owner_name, icon_server, original_format.

See Also

FlickrResponseListener.onPhotosetsGetPhotos

http://www.flickr.com- /services- /api- /flickr.photosets.getPhotos.html

photosetsOrderPhotosets

function photosetsOrderPhotosets(photosetIds: Array)

Set the order of photosets for the calling user.

Parameters

photosetIdsAn array of photoset IDs, ordered with the set to show first, first in the list.  Any set IDs not given in the list will be set to appear at the end of the list, ordered by their IDs.

See Also

<FlickrResponseListener.onPhotosetsOrderPhotosets>

http://www.flickr.com- /services- /api- /flickr.photosets.orderSets.html

photosetsRemovePhoto

function photosetsRemovePhoto(photosetId: Number,
photoId: Number)

Remove a photo from a photoset.

Parameters

photosetIdThe id of the Photoset to remove a Photo from.
photoIdThe id of the Photo to remove from the set.

See Also

FlickrResponseListener.onPhotosetsRemovePhoto

http://www.flickr.com- /services- /api- /flickr.photosets.removePhoto.html

tagsGetListPhoto

public function tagsGetListPhoto(photoId: Number)

Calls flickr.tags.getListPhoto to get the tag list for a given photo.

Parameters

photoIdThe id of the photo to return tags for.

See Also

<FlickrResponseListener.onTagsListPhoto>

FlickrResponseListener.onError

http://www.flickr.com- /services- /api- /flickr.tags.getListPhoto.html

tagsGetListUser

public function tagsGetListUser(userId: String)

Calls flickr.tags.getListUser to get the tag list for a given user (or the currently logged in user).

Parameters

userIdThe NSID of the user to fetch the tag list for.  [Optional: default=the currently logged in user (if any)]

See Also

FlickrResponseListener.onTagsGetListUser

FlickrResponseListener.onError

http://www.flickr.com- /services- /api- /flickr.tags.getListUser.html

tagsGetListUserPopular

public function tagsGetListUserPopular(userId: String,
count: Number)

Calls flickr.tags.getListUserPopular to get the popular tags for a given user (or the currently logged in user).

Parameters

userIDThe NSID of the user to fetch the tag list for.  [Optional: default=the currently logged in user (if any)]
countNumber of popular tags to return.  [Optional: default=10]

See Also

FlickrResponseListener.onTagsGetListUserPopular

FlickrResponseListener.onError

http://www.flickr.com- /services- /api- /flickr.tags.getListUserPopular.html

tagsGetRelated

public function tagsGetRelated(tag: String)

Calls flickr.tags.getRelated to get a list of tags ‘related’ to the given tag, based on clustered usage analysis.

Parameters

tagThe tag to fetch related tags for.

See Also

FlickrResponseListener.onTagsGetRelated

FlickrResponseListener.onError

http://www.flickr.com- /services- /api- /flickr.tags.getRelated.html

testEcho

public function testEcho()

Calls flickr.test.echo - forwards any arguments on to the Flickr API

Parameters

1...nAny number of parameters to echo back from the server [Optional]

See Also

FlickrResponseListener.onTestEcho

FlickrResponseListener.onError

http://www.flickr.com- /services- /api- /flickr.test.echo.html

testLogin

public function testLogin()

Calls flickr.test.login - A testing method which checks if the caller is logged in then returns their username.

See Also

FlickrResponseListener.onTestLogin

FlickrResponseListener.onError

http://www.flickr.com- /services- /api- /flickr.test.login.html

callMethod

public function callMethod(method: String,
additionalArguments: Object,
requiresSigning: Boolean):Void

Used to call a method on the flickr API.

When the method returns an onAPIResponse event is broadcast to any registered listeners.

You should use the methods above unless you are calling a method on Flickr.com which hasn’t yet been implemented in this API as then you will get argument type checking etc...

Parameters

methodThe name of the method you want to call
additionalArgumentsAny additional arguments required by the object [Optional]
requiresSigningWhether the called method requires signing.  Used by methods such as flickr.auth.getFrob which need to be signed but are called before the user is auth’d.  Once a user is auth’d then all methods are automatically signed.  [optional: default=false]

See also

Flickr.onAPIResponse

onAPIResponse

private function onAPIResponse(success: Boolean):Void

Called internally on recepit of a response from a request to the <REST_ENDPOINT>.  Interperets the received XML and broadcasts an onAPIResponse event to any registered listeners.  If the XML was the result of a known method call then the broadcast event will include sensible information, otherwise it will just be the XML for parsing outside this class (e.g. if a new method has been added to the Flickr.com API and not programmed into this class).

Parameters

successWhether the call to the API was successfull (e.g. the server specfied in <REST_ENDPOINT> was connected to) or not.

_prepareQuerystring

function _prepareQuerystring(method: String,
additionalArguments: Object,
requiresSigning: Boolean)

Internal function used to convert a list of arguments into a querystring for use in a URL for a call to flickr.com.  Deals with signing the call as necessary.  Can also be used when a signed querystring is needed outside of the API (e.g. for uploading).

Parameters

methodThe method on flickr.com you are calling
additionalArgumentsAn object whose name/value pairs are what need adding to the URL
requiresSigningWhether this method requires signing.  Should only be called by the inital

Returns

The generated querystring.

_parsePhotoXML

Private internal function used to avoid duplicate code to parse “the standard photo list xml”

Params

pxThe “standard photo list xml” from flickr.

Returns

A ResultsSet.

_parsePhotosetXml

private function _parsePhotosetXml(photosetXml: XMLNode,
owner: Person):Photoset

Private internal function used to avoid duplicate code when parsing the standard photoset XML

Parameters

photosetXmlAn XML node describing a photoset.
ownerThe owner of this Photoset - leave as undefined if they exist as an attribute in the XML...

Returns

The created Photoset.

_parseContextXml

private function _parseContextXml(contextXML: XMLNode):Object

Private internal function used to avoid duplicate code when parsing the standard context XML

Parameters

contextXMLThe contextXML to parse

Returns

An object containing count:Number, prevphoto:Photo and nextphoto:Photo

getFlickr

public static function getFlickr():Flickr

Returns a reference to the Flickr instance - if none exists yet then creates one and returns a reference to that.

Returns

A Flickr instance

private var _apiKey: String
Your Flickr API Key.
private var _REST_ENDPOINT: String
The place for all API calls to connect to.
private var _AUTH_ENDPOINT: String
The base path you go to when you want to authenticate on flickr.com
public static var STATUS_BUSY: Number
The API is already waiting for the response to a method call so cannot make another call
public static var STATUS_ERROR_CONNECTING: Number
Could not connect to the server (e.g.
public static var STATUS_INVALID_XML: Number
The XML returned by the server wasn’t in a &lt;rsp /&gt; tag.
public static var STATUS_USER_NOT_LOGGED_IN: Number
The user wasn’t logged in and tried to access a method that requires authentication (returned from flickr.com)
public static var STATUS_INVALID_API_KEY: Number
The API key sent to flickr was invalid (returned from flickr.com)
public static var STATUS_OK: Number
There was no errors and valid XML was returned.
public static var PERM_NOBODY: Number
A constant representing permissions for nobody.
public static var PERM_FRIENDS: Number
A constant representing permissions for friends and family.
public static var PERM_CONTACTS: Number
A constant representing permissions for contacts.
public static var PERM_EVERYBODY: Number
A constant representing permissions for everybody.
private var _secret: String
Private variable to store this app’s shared secret for use with the authentication API.
private var _authToken: String
Private variable which stores the token generated by a successfull authorisation.
private var _authFrob: String
Private variable which is used to store the frob which is used for the first part of the authentication process.
var authPerms: String
A variable describing the permissions the currently auth’d user has within this app.
var authUser: Person
A Person object for the currently auth’d user (if there is one).
Class to describe a person from Flickr.
private function Flickr()
Constructor - as this class implements the Singleton pattern do not call directly but rather access through Flickr.getFlickr.
public static function getFlickr():Flickr
Returns a reference to the Flickr instance - if none exists yet then creates one and returns a reference to that.
public function authSetSecret(secret: String)
Use to set the value of the shared secret before any calls to methods like authLogin or authCheckToken
public function authLogin(perms: String)
Pops open a login window so that the user can authenticate with the flickr.com website.
public function authCheckToken(authToken: String)
Calls flickr.auth.checkToken to get the credentials attached to an authentication token.
public function authGetFrob(authIsLoggingIn: Boolean)
Calls flickr.auth.getFrob to get a frob to be used during authentication.
public function authGetToken()
Calls flickr.auth.getToken to get the auth token for the given frob, if one has been attached.
public function authLogout()
Simple function which forgets the information that was making this user be logged in.
private function _authOpenLogin()
Internal function which generates the relevant link and pops open the login window on flickr.com.
private function _authSignCall(urlArguments: Object):String
Internal, private function which is used to generate the api_sig used to sign a call.
public function contactsGetList(filter: String)
Calls flickr.contacts.getList to get a list of contacts for the calling user.
public function contactsGetPublicList(nsid: String)
Calls flickr.contacts.getPublicList to get a list of contacts a user.
public function favoritesAdd(photoId: Number)
Calls flickr.favorites.add to add a photo to a user’s favorites list.
public function favoritesGetList(userId: String,
extras: String,
perPage: Number,
page: Number)
Calls flickr.favorites.getList to get a list of the user’s favorite photos.
public function favoritesGetPublicList(userId: String,
extras: String,
perPage: Number,
page: Number)
Calls flickr.favorites.getPublicList to get a list of favorite public photos for the given user.
public function favoritesRemove(photoId: Number)
Calls flickr.favorites.remove to remove a photo from a user’s favorites list.
function groupsPoolsAdd(photoId: Number,
groupId: String)
Add a photo to a group’s pool.
function groupsPoolsGetContext(photoId: Number,
groupId: String)
Gets next and previous photos for a photo in a group pool.
function groupsPoolsGetGroups()
Gets a list of groups to which you can add photos.
function groupsPoolsGetPhotos(groupId: String,
tags: String,
extras: String,
perPage: Number,
page: Number,
userId: String)
Gets a list of pool photos for a given group, based on the permissions of the group and the user logged in (if any).
function groupsPoolsRemove(photoId: Number,
groupId: String)
Remove a photo from a group pool.
function peopleFindByEmail(email: String)
Calls flickr.people.findByEmail to get a user’s NSID, given their email address.
function peopleFindByUsername(username: String)
Calls flickr.people.findByUsername to get a user’s NSID, given their username.
function peopleGetInfo(nsid: String)
Calls flickr.people.getInfo to get information about a user.
function peopleGetPublicGroups(nsid: String)
Calls flickr.people.getPublicGroups to get the list of public groups a user is a member of.
function peopleGetPublicPhotos(nsid: String,
extras: String,
perPage: Number,
page: Number)
Calls flickr.people.getPublicPhotos to get a list of public photos for the given user.
function peopleGetUploadStatus()
Calls flickr.people.getUploadStatus to get information for the calling user related to photo uploads.
function photosAddTags (photoId: Number,
tags: String)
Calls flickr.photos.addTags to add tags to a given photo.
function photosGetAllContexts(photoId: Number)
Returns all visble sets and pools the photo belongs to.
function photosGetContactsPhotos (count: Number,
justFriends: Number,
singlePhoto: Number,
includeSelf: Number,
extras: String)
Calls flickr.photos.getContactsPhotos to fetch a list of recent photos from the calling users’ contacts.
function photosGetContactsPublicPhotos (nsid: String,
count: Number,
justFriends: Number,
singlePhoto: Number,
includeSelf: Number,
extras: String)
Calls flickr.photos.getContactsPublicPhotos to fetch a list of recent public photos from a users’ contacts.
function photosGetContext (photoId: Number)
Calls flickr.photos.getContext to return next and previous photos for a photo in a photostream.
function photosGetCounts (dates: String,
takenDates: String)
Calls flickr.photos.getCounts to get a list of photo counts for the given date ranges for the calling user.
function photosGetExif (photoId: Number,
secret: String)
Calls flickr.photos.getExif to return a list of EXIF/TIFF/GPS tags for a given photo.
function photosGetInfo (photoId: Number,
secret: String)
Calls flickr.photos.getInfo to get information about a photo..
function photosGetNotInSet (extras: String,
perPage: Number,
page: Number)
Calls flickr.photos.getNotInSet to get a list of your photos that are not part of any sets.
function photosGetPerms (photoId: Number)
Calls flickr.photos.getPerms to get permissions for a photo.
function photosGetRecent (extras: String,
perPage: Number,
page: Number)
Calls flickr.photos.getRecent to get a list of the latest public photos uploaded to flickr.
function photosGetSizes (photoId: Number)
Calls flickr.photos.getRecent to get the available sizes for a photo.
function photosGetUntagged (extras: String,
perPage: Number,
page: Number)
Calls flickr.photos.getUntagged to get a list of your photos with no tags.
function photosRemoveTag (tagId: Number)
Calls flickr.photos.removeTag to remove a tag from a photo.
function photosSearch (params)
Calls flickr.photos.search to get a list of photos matching some criteria.
function photosSetDates (photoId: Number,
datePosted: Date,
dateTaken: Date,
dateTakenGran: Number)
Calls flickr.photos.setDates to set one or both of the dates for a photo..
function photosSetMeta (photoId: Number,
title: String,
description: String)
Calls flickr.photos.setMeta to set the meta information for a photo.
function photosSetPerms (photoId: Number,
isPublic: Number,
isFriend: Number,
isFamily: Number,
permComment: Number,
permAddMeta: Number)
Calls flickr.photos.setPerms to set permissions for a photo..
function photosSetTags (photoId: Number,
tags: String)
Calls flickr.photos.setTags to set the tags for a photo.
function photosetsAddPhoto(photosetId: Number,
photoId: Number)
Add a photo to the end of an existing photoset.
function photosetsCreate(title: String,
description: String,
primaryPhotoId: Number)
Create a new photoset for the calling user.
function photosetsDelete(photosetId: Number)
Delete a photoset.
function photosetsEditMeta(photosetId: Number,
title: String,
description: String)
Modify the meta-data for a photoset.
function photosetsEditPhotos(photosetId: Number,
primaryPhotoId: Number,
photoIds: Array)
Modify the photos in a photoset.
function photosetsGetContext(photoId: Number,
photosetId: Number)
Returns next and previous photos for a photo in a set.
function photosetsGetInfo(photosetId: Number)
Gets information about a photoset.
function photosetsGetList(userId: String)
Gets the photosets belonging to the specified user.
function photosetsGetPhotos(photosetId: Number,
extras: String)
Get the list of photos in a set.
function photosetsOrderPhotosets(photosetIds: Array)
Set the order of photosets for the calling user.
function photosetsRemovePhoto(photosetId: Number,
photoId: Number)
Remove a photo from a photoset.
public function tagsGetListPhoto(photoId: Number)
Calls flickr.tags.getListPhoto to get the tag list for a given photo.
public function tagsGetListUser(userId: String)
Calls flickr.tags.getListUser to get the tag list for a given user (or the currently logged in user).
public function tagsGetListUserPopular(userId: String,
count: Number)
Calls flickr.tags.getListUserPopular to get the popular tags for a given user (or the currently logged in user).
public function tagsGetRelated(tag: String)
Calls flickr.tags.getRelated to get a list of tags ‘related’ to the given tag, based on clustered usage analysis.
public function testEcho()
Calls flickr.test.echo - forwards any arguments on to the Flickr API
public function testLogin()
Calls flickr.test.login - A testing method which checks if the caller is logged in then returns their username.
public function callMethod(method: String,
additionalArguments: Object,
requiresSigning: Boolean):Void
Used to call a method on the flickr API.
private function onAPIResponse(success: Boolean):Void
Called internally on recepit of a response from a request to the REST_ENDPOINT.
function _prepareQuerystring(method: String,
additionalArguments: Object,
requiresSigning: Boolean)
Internal function used to convert a list of arguments into a querystring for use in a URL for a call to flickr.com.
private function _parsePhotosetXml(photosetXml: XMLNode,
owner: Person):Photoset
Private internal function used to avoid duplicate code when parsing the standard photoset XML
private function _parseContextXml(contextXML: XMLNode):Object
Private internal function used to avoid duplicate code when parsing the standard context XML
Class to define a listener for responses from the FlickrAPI.
public function onAuthGetFrob(frob)
Called when there is a successful response from a call to flickr.auth.getFrob
public function onAuthCheckToken(token)
Called when there is a successful response from a call to flickr.auth.getToken or flickr.auth.checkToken.
function onError(errorCode: Number,
errorDescription: String,
method: String)
Called when the Flickr API returns an error code..
function onContactsGetList(user: Person,
filter: String)
Called when there is a response from a call to flickr.contacts.getList.
function onContactsGetPublicList(user: Person)
Called when there is a response from a call to flickr.contacts.getPublicList.
function onFavoritesAdd(photo: Photo)
Called when there is a response from a call to flickr.favorites.add.
function onFavoritesGetList(user: Person,
resultsSet: ResultsSet)
Called when there is a response from a call to flickr.favorites.getList.
function onFavoritesGetPublicList(user: Person,
resultsSet: ResultsSet)
Called when there is a response from a call to flickr.favorites.getPublicList.
function onFavoritesRemove(photo: Photo)
Called when there is a response from a call to flickr.favorites.remove.
function onGroupsPoolsAdd(photo: Photo,
group: Group)
Called when there is a response from a call to flickr.groups.pools.add
function onGroupsPoolsGetGroups(user: Person)
Called when there is a response from a call to flickr.groups.pools.getGroups
function onGroupsPoolsGetPhotos(group: Group,
photos: Array,
resultsSet: ResultsSet)
Called when there is a response from a call to flickr.groups.pools.getPhotos
function onPeopleFindByEmail(person: Person)
Called when there is a response from a call to flickr.people.findByEmail.
function onPeopleFindByUsername(person: Person)
Called when there is a response from a call to flickr.people.findByUsername.
function onPeopleGetInfo(person: Person)
Called when there is a response from a call to flickr.people.getInfo.
function onPeopleGetPublicGroups(person: Person)
Called when there is a response from a call to flickr.people.getPublicGroups.
function onPeopleGetPublicPhotos(person: Person,
resultsSet: ResultsSet)
Called when there is a response from a call to flickr.people.getPublicPhotos.
function onPeopleGetUploadStatus(person: Person)
Called when there is a response from a call to flickr.people.getUploadStatus.
function onPhotosAddTags(photo: Photo,
tags: String)
Called when there is a response from a call to flickr.photos.addTags.
function onPhotosGetAllContexts(photo: Photo)
Called when there is a response from a call to flickr.people.getAllContexts.
function onPhotosGetContactsPhotos(photos: Array,
resultsSet: ResultsSet)
Called when there is a response from a call to flickr.people.getContactsPhotos.
function onPhotosGetContactsPublicPhotos(person: Person,
photos: Array,
resultsSet: ResultsSet)
Called when there is a response from a call to flickr.people.getContactsPhotos.
function onPhotosGetContext(photo: Photo)
Called when there is a response from a call to flickr.people.getContext.
function onPhotosGetCounts(counts: Array)
Called when there is a response from a call to flickr.people.getCounts.
function onPhotosGetExif(photo: Photo)
Called when there is a response from a call to flickr.people.getExif.
Class to describe some ExifData as returned by Flickr.
function onPhotosGetInfo(photo: Photo)
Called when there is a response from a call to flickr.people.getInfo.
function onPhotosGetNotInSet(photos: Array,
resultsSet: ResultsSet)
Called when there is a response from a call to flickr.people.getPhotosNotInSet.
function onPhotosGetRecent(photos: Array,
resultsSet: ResultsSet)
Called when there is a response from a call to flickr.people.getRecent.
function onPhotosGetSizes(photo: Photo)
Called when there is a response from a call to flickr.people.getSizes.
function onPhotosGetUntagged(photos: Array,
resultsSet: ResultsSet)
Called when there is a response from a call to flickr.people.getUntagged.
function onPhotosRemoveTag(tagId: Number)
Called when there is a response from a call to flickr.people.removeTag.
function onPhotosSearch(photos: Array,
resultsSet: ResultsSet)
Called when there is a response from a call to flickr.people.search.
function onPhotosSetDates(photo: Photo)
Called when there is a response from a call to flickr.people.setDates.
function onPhotosSetMeta(photo: Photo)
Called when there is a response from a call to flickr.people.setMeta.
function onPhotosSetTags(photo: Photo)
Called when there is a response from a call to flickr.people.setTags.
function setTags(tags: String,
author: Person)
Set’s this Photo’s _tags...
function onPhotosetsAddPhoto(photoset: Photoset)
Called when there is a response from a call to flickr.photosets.addPhoto
Class to describe a photo from Flickr.
function onPhotosetsCreate(photoset: Photoset)
Called when there is a response from a call to flickr.photosets.create
Describes a Photoset on flickr.com
function onPhotosetsDelete(photosetId: Number)
Called when there is a response from a call to flickr.photosets.delete
function onPhotosetsEditMeta(photoset: Photoset)
Called when there is a response from a call to flickr.photosets.editMeta
function onPhotosetsEditPhotos(photoset: Photoset)
Called when there is a response from a call to flickr.photosets.editPhotos
function onPhotosetsGetContext(photo: Photo,
photoset: Photoset)
Called when there is a response from a call to flickr.photosets.getContext
function onPhotosetsGetInfo(photoset: Photoset)
Called when there is a response from a call to flickr.photosets.getInfo
function onPhotosetsGetList(user: Person)
Called when there is a response from a call to flickr.photosets.getList
function onPhotosetsGetPhotos(photoset: Photoset)
Called when there is a response from a call to flickr.photosets.getPhotos
function onPhotosetsRemovePhoto(photoset: Photoset)
Called when there is a response from a call to flickr.photosets.removePhoto
function onTagsGetListUser(person: Person)
Called when there is a response from a call to flickr.tags.getListUser.
function onTagsGetListUserPopular(person: Person)
Called when there is a response from a call to flickr.tags.getListUserPopular.
function onTagsGetRelated(sourceTag: Tag)
Called when there is a response from a call to flickr.tags.tagsGetRelated.
function onTestEcho(params: Object)
Called when there is a response from a call to flickr.test.echo.
function onTestLogin(user: Person)
Called when there is a response from a call to flickr.test.login
Handles the search responses from flickr.com packaging them up with relevant information about the query.