FlickrFavorites
| Kind of class: | class |
|---|---|
| Inherits from: | none |
| Version: | 1.0 |
| Author: | Fabricio Zuardi |
| Classpath: | com.zuardi.flickr.FlickrFavorites |
| File last modified: | Saturday, 04 September 2004, 10:39:44 |
FlickrFavorites
last update 08/29/2004
last update 08/29/2004
Summary
Constructor
- FlickrFavorites (api_key:String, user_email:String, user_password:String, rest_endpoint:String)
- These parameters are filled automatically if you are using a Flickr object
Class properties
- REST_ENDPOINT : String
Instance properties
Instance methods
- getList (user_email:String, user_password:String, user_id:String, per_page:String, page:String)
- Returns a list of the user's favorite photos.
- addPhoto (user_email:String, user_password:String, photo_id:String)
- Adds a photo to a user's favorites list.
- remove (user_email:String, user_password:String, photo_id:String)
- Removes a photo from a user's favorites list.
- addOrRemove (user_email:String, user_password:String, photo_id:String, method:String)
Constructor
FlickrFavorites
function FlickrFavorites (
api_key:String,
user_email:String,
user_password:String,
rest_endpoint:String)
These parameters are filled automatically if you are using a Flickr object
otherwise, if you are instantiating a FlickrBlogs, object you have to enter the parameters
otherwise, if you are instantiating a FlickrBlogs, object you have to enter the parameters
Parameters:
api_key :
(required) The api_key of the application
user_email :
(optional) The email to use on methods that requires user authentication
user_password:
(optional) The email to use on methods that requires user authentication
rest_endpoint:
(optional) The rest endpoint url
See also:
Class properties
REST_ENDPOINT
static private REST_ENDPOINT:String = "http://www.flickr.com/services/rest/"
(read)
Instance properties
_api_key
private _api_key:String
(read)
_email
private _email:String
(read)
_list
private _list:Array
(read)
_password
private _password:String
(read)
_response
private _response:XML
(read)
_rest_endpoint
private _rest_endpoint:String
(read)
list
list:Array
(read)
a list of photos, resulted from a getList method call
is an Array of objects, each object has the following attributes
id, owner, title, ispublic, isfriend, isfamily
is an Array of objects, each object has the following attributes
id, owner, title, ispublic, isfriend, isfamily
See also:
response
response:XML
(read)
last xml returned from server
Instance methods
addOrRemove
private function addOrRemove (
user_email:String,
user_password:String,
photo_id:String,
method:String)
addPhoto
function addPhoto (
user_email:String,
user_password:String,
photo_id:String)
Adds a photo to a user's favorites list.
OBS: This method couldnt be called "add" beacause that's a reserved keyword in Flash
OBS: This method couldnt be called "add" beacause that's a reserved keyword in Flash
Parameters:
user_email :
(Required) The email used to authenticate on Flickr
user_password:
(Required) The password used to authenticate on Flickr
photo_id :
(Required) The id of the photo to add to the user's favorites.
my_flickr = new Flickr(APIKEY); my_flickr.favorites.onAdd = function(error){ if(!error){ trace("photo successful added") }else{ trace(error) } }; my_flickr.favorites.addPhoto(USEREMAIL,USERPASSWD,PHOTOID);
getList
function getList (
user_email:String,
user_password:String,
user_id:String,
per_page:String,
page:String)
Returns a list of the user's favorite photos.
entries that can be accessed through the list attribute
entries that can be accessed through the list attribute
Parameters:
user_email :
(Required) The email used to authenticate on Flickr
user_password:
(Required) The password used to authenticate on Flickr
user_id :
(Optional) The NSID of the user to fetch the favorites list for.
If this argument is omitted, the favorites list for the calling user is returned.
If this argument is omitted, the favorites list for the calling user is returned.
per_page :
(Optional) Number of photos to return per page. If this argument is ommited, it defaults to 100.
The maximum allowed value is 500.
The maximum allowed value is 500.
page :
(Optional) The page of results to return. If this argument is ommited, it defaults to 1.
Usage:
-
my_flickr = new Flickr(APIKEY); my_flickr.favorites.onGetList = function(error,obj){ if(!error){ trace(obj.list[0].id) trace(obj.list[0].owner) trace(obj.list[0].title) trace(obj.list[0].ispublic) trace(obj.list[0].isfriend) trace(obj.list[0].isfamily) }else{ trace(error) } }; my_flickr.favorites.getList(USEREMAIL,USERPASSWD);
remove
function remove (
user_email:String,
user_password:String,
photo_id:String)
Removes a photo from a user's favorites list.
Parameters:
user_email :
(Required) The email used to authenticate on Flickr
user_password:
(Required) The password used to authenticate on Flickr
photo_id :
(Required) The id of the photo to add to the user's favorites.
my_flickr = new Flickr(APIKEY); my_flickr.favorites.onRemove = function(error){ if(!error){ trace("photo successful removed") }else{ trace(error) } }; my_flickr.favorites.remove(USEREMAIL,USERPASSWD,PHOTOID);
Event handlers
onGetList
onGetList:Function
(read)
callback function, called at the end of a getList method
See also:
onRemove
onRemove:Function
(read)
callback function, called at the end of a remove method
See also: