FlickrPeople
Inherits from:none (FlickrPeople is a root class)
- Version: 1.0
- Author: Fabricio Zuardi
- Classpath: com.zuardi.flickr.FlickrPeople
- File last modified: Saturday, 04 September 2004, 09:40:14
FlickrPeople
last update 08/28/2004Summary
Constructor
Instance properties
Instance methods
Constructor
FlickrPeople
function FlickrPeople (
api_key:String,
rest_endpoint:String)
These parameters are filled automatically if you are using a Flickr object
otherwise, if you are instantiating a FlickrPeople object, you have to enter the parameters
Parameters
api_key: :
(required) The api_key of the application
rest_endpoint::
(optional) The rest endpoint url
Instance properties
onFinded
onFinded:Function
(read,write)callback function, called at the end of a findByEmail, or findByUsername method
See also
onInfo
onInfo:Function
(read,write)callback function, called at the end of a getInfo method
See also
onlineList
onlineList:Array
(read)a list of the online users, resulted from a getOnlineList method call
is an Array of objects, each object has the following attributes
id, username, online, away_msg
See also
onOnlineList
onOnlineList:Function
(read,write)callback function, called at the end of a getOnlineList method
See also
onPublicPhotos
onPublicPhotos:Function
(read,write)callback function, called at the end of a getPublicPhotos method
See also
publicPhotos
publicPhotos:Array
(read)a list of photos, resulted from a getPublicPhotos method call
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
findByEmail
public function findByEmail (
find_email:String)
Return a user's NSID, given their email address
the results are stored in the user_id and username attributes
Parameters
find_email:
The email used to find user nsid and username
Usage
my_flickr = new Flickr(APIKEY);
my_flickr.people.onFinded = function(error,obj){
if(!error){
trace(obj.username)
}else{
trace(error)
}
};
my_flickr.people.findByEmail("someemail@somedomain.com");findByUsername
public function findByUsername (
username:String)
Return a user's NSID, given their username.
the results are stored in the user_id and username attributes
Parameters
username:
The username used to find user nsid and username
Usage
my_flickr = new Flickr(APIKEY);
my_flickr.people.onFinded = function(error,obj){
if(!error){
trace(obj.username)
trace(obj.user_id)
}else{
trace(error)
}
};
my_flickr.people.findByUsername("someusername");getInfo
public function getInfo (
user_id:String)
Get information about a user
the results are stored in the attributes: username, realname, location, firstDate, count, isadmin and ispro
Parameters
user_id:
The NSID of the user to fetch information about
Usage
my_flickr = new Flickr(APIKEY);
my_flickr.people.onInfo = function(error,obj){
if(!error){
trace(obj.username)
trace(obj.realname)
trace(obj.location)
trace(obj.firstdate)
trace(obj.count)
trace(obj.isadmin)
trace(obj.ispro)
}else{
trace(error)
}
};
my_flickr.people.getInfo("49503114626@N01");getOnlineList
public function getOnlineList (
)
Get a list of all online users.
the results are stored in the onlineList attribute
Usage
my_flickr = new Flickr(APIKEY);
my_flickr.people.onOnlineList = function(error,obj){
if(!error){
trace(obj.onlineList[0].id)
trace(obj.onlineList[0].username)
trace(obj.onlineList[0].online)
trace(obj.onlineList[0].away_msg)
}else{
trace(error)
}
};
my_flickr.people.getOnlineList();getPublicPhotos
public function getPublicPhotos (
user_id:String,
per_page:Number,
page:Number)
Get a list of public photos for the given user.
the results are stored in the publicPhotos attribute
Parameters
user_id :
(required) The NSID of the user who's photos to return.
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.people.onPublicPhotos = function(error,obj){
if(!error){
trace(obj.publicPhotos[0].id)
trace(obj.publicPhotos[0].owner)
trace(obj.publicPhotos[0].title)
trace(obj.publicPhotos[0].ispublic)
trace(obj.publicPhotos[0].isfriend)
trace(obj.publicPhotos[0].isfamily)
}else{
trace(error)
}
};
my_flickr.people.getPublicPhotos(USERID);