FlickrPhotos
| Kind of class: | class |
|---|---|
| Inherits from: | none |
| Version: | 1.0 |
| Author: | Fabricio Zuardi |
| Classpath: | com.zuardi.flickr.FlickrPhotos |
| File last modified: | Saturday, 04 September 2004, 10:40:46 |
FlickrPhotos
last update 09/02/2004
last update 09/02/2004
Summary
Constructor
- FlickrPhotos (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
- _api_key : String
- _email : String
- _password : String
- _rest_endpoint : String
- _response : XML
- _photo_info : Object
- _sizes : Array
- response : XML
- last xml returned from server
- photo_info : Object
- sizes : Array
Instance methods
Event handlers
- onGetInfo : Function
- callback function, called at the end of a getInfo method
- onGetSizes : Function
- callback function, called at the end of a getSizess method
Constructor
FlickrPhotos
function FlickrPhotos (
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 FlickrPhotos, object you have to enter the parameters
otherwise, if you are instantiating a FlickrPhotos, 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)
_password
private _password:String
(read)
_photo_info
private _photo_info:Object
(read)
_response
private _response:XML
(read)
_rest_endpoint
private _rest_endpoint:String
(read)
_sizes
private _sizes:Array
(read)
photo_info
photo_info:Object
(read)
response
response:XML
(read)
last xml returned from server
sizes
sizes:Array
(read)
Instance methods
getInfo
function getInfo (
photo_id:String)
Get information about a photo.
photo_info:
dateuploaded, ownerId, ownerUsername, ownerRealName, ownerLocation, title, description, ispublic,
isfamily, isfriend, cancomment, canaddmeta, comments, notes (id, author, authorname, x, y, w, h,note), tags
photo_info:
dateuploaded, ownerId, ownerUsername, ownerRealName, ownerLocation, title, description, ispublic,
isfamily, isfriend, cancomment, canaddmeta, comments, notes (id, author, authorname, x, y, w, h,note), tags
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 is of the photo to fetch information for.
Usage:
-
my_flickr = new Flickr(APIKEY); my_flickr.photos.onGetInfo = function(error,obj){ if(!error){ trace(obj.photo_info.dateuploaded) trace(obj.photo_info.ownerId) trace(obj.photo_info.ownerUsername) trace(obj.photo_info.ownerRealName) trace(obj.photo_info.ownerLocation) trace(obj.photo_info.title) trace(obj.photo_info.description) trace(obj.photo_info.ispublic) trace(obj.photo_info.isfamily) trace(obj.photo_info.isfriend) trace(obj.photo_info.cancomment) trace(obj.photo_info.canaddmeta) trace(obj.photo_info.comments) trace(obj.photo_info.notes[0].id) trace(obj.photo_info.notes[0].author) trace(obj.photo_info.notes[0].authorname) trace(obj.photo_info.notes[0].x) trace(obj.photo_info.notes[0].y) trace(obj.photo_info.notes[0].w) trace(obj.photo_info.notes[0].h) trace(obj.photo_info.notes[0].note) trace(obj.photo_info.tags[0]) }else{ trace(error) } }; my_flickr.photos.getInfo(PHOTOID);
getSizes
function getSizes (
photo_id:String)
Returns the available sizes for a photo.
sizes:
label, width, height, source, url
sizes:
label, width, height, source, url
Parameters:
photo_id:
(Required) The id of the photo to fetch size information for.
Usage:
-
my_flickr = new Flickr(APIKEY); my_flickr.photos.onGetSizes = function(error,obj){ if(!error){ trace(obj.sizes[0].label) trace(obj.sizes[0].width) trace(obj.sizes[0].height) trace(obj.sizes[0].source) trace(obj.sizes[0].url) }else{ trace(error) } }; my_flickr.photos.getSizes(PHOTOID);