FlickrPeople

Kind of class:class
Inherits from:none
Version:1.0
Author:Fabricio Zuardi
Classpath:com.zuardi.flickr.FlickrPeople
File last modified:Saturday, 04 September 2004, 10:40:14
FlickrPeople
last update 08/28/2004

Summary


Constructor
  • FlickrPeople (api_key:String, rest_endpoint:String)
    • These parameters are filled automatically if you are using a Flickr object
Class properties
Instance properties
Instance methods
  • findByEmail (find_email:String)
    • Return a user's NSID, given their email address
  • findByUsername (username:String)
    • Return a user's NSID, given their username.
  • _findBy (find_argument:String, flag:Number)
  • getInfo (user_id:String)
    • Get information about a user
  • getOnlineList
  • getPublicPhotos (user_id:String, per_page:Number, page:Number)
    • Get a list of public photos for the given user.
Event handlers
  • onFinded : Function
    • callback function, called at the end of a findByEmail, or findByUsername method
  • onInfo : Function
    • callback function, called at the end of a getInfo method
  • onOnlineList : Function
    • callback function, called at the end of a getOnlineList method
  • onPublicPhotos : Function
    • callback function, called at the end of a getPublicPhotos method

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

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)

_count

private _count:Number
(read)

_firstdate

private _firstdate:Date
(read)

_isadmin

private _isadmin:Boolean
(read)

_ispro

private _ispro:Boolean
(read)

_location

private _location:String
(read)

_onlineList

private _onlineList:Array
(read)

_publicPhotos

private _publicPhotos:Array
(read)

_realname

private _realname:String
(read)

_response

private _response:XML
(read)

_rest_endpoint

private _rest_endpoint:String
(read)

_user_id

private _user_id:String
(read)

_username

private _username:String
(read)

count

count:Number
(read)

firstdate

firstdate:Date
(read)

isadmin

isadmin:Boolean
(read)

ispro

ispro:Boolean
(read)

location

location:String
(read)

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:

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:

realname

realname:String
(read)

response

response:XML
(read)

last xml returned from server

user_id

user_id:String
(read)

username

username:String
(read)

Instance methods

_findBy

private function _findBy (
find_argument:String, flag:Number)

findByEmail

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

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

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

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

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);

Event handlers

onFinded

onFinded:Function
(read)

callback function, called at the end of a findByEmail, or findByUsername method

onInfo

onInfo:Function
(read)

callback function, called at the end of a getInfo method
See also:

onOnlineList

onOnlineList:Function
(read)

callback function, called at the end of a getOnlineList method
See also:

onPublicPhotos

onPublicPhotos:Function
(read)

callback function, called at the end of a getPublicPhotos method
See also: