FlickrFavorites
Inherits from:none (FlickrFavorites is a root class)
- Version: 1.0
- Author: Fabricio Zuardi
- Classpath: com.zuardi.flickr.FlickrFavorites
- File last modified: Saturday, 04 September 2004, 09:39:43
FlickrFavorites
last update 08/29/2004Summary
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
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
Instance properties
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
See also
onAdd
onAdd:Function
(read,write)callback function, called at the end of a add method
See also
onGetList
onGetList:Function
(read,write)callback function, called at the end of a getList method
See also
onRemove
onRemove:Function
(read,write)callback function, called at the end of a remove method
See also
response
response:XML
(read)last xml returned from server
Instance methods
addPhoto
public 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
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
public 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
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.
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.
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
public 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);