com. kelvinluck. flickr. Person

Class to describe a person from Flickr.

Instances of this class are created to hold people who have been returned in data from calls to the Flickr API.

Author

Kelvin Luck < kelvin at kelvinluck dot com >

Summary
Class to describe a person from Flickr.
This person’s nsid.
This person’s username.
This person’s email address.
Used to build the url to the users’ buddyicon
If this person is a friend.
If this person is family.
If this person is ignored.
If this person is an admin.
If this person has a Pro account.
This person’s real name.
This person’s location.
This person’s mboxSha1sum.
The number of photos this user has taken.
The date this persons first photograph was uploaded.
The date this persons first photograph was taken.
The bandwidth this user has available, in bytes per month.
The bandwidth this user has used this month, in bytes.
The maximum size per file that this user can upload, in bytes.
An Array containing references to all of this Person’s photos.
An Object containing references to all of this Person’s Tag’s
An Array containing references to this user’s Photosets
An Array containing references to this user’s Groups
An Array containing references to all of this Person’s contacts.
An Array containing references to all of this Person’s favourites as Photo objects indexed by the id of each of the favourites.
A private static Object containing Person objects.
Add’s a public group to this user and notes whether this user is an admin of that group.
Gets a list of the public groups that a user is a member of (if Flickr.peopleGetPublicGroups has been called for that user.
Add’s a public contact to this user
Gets a list of the public contacts that this user has (if addPublicContact has been called for this user.
Adds a favourite Photo to this user.
Removes a favourite Photo from this user.
Gets a list of the favorite Photo’s that this user has.
Adds this Photo into this Person’s _photos Array if it isn’t already there
Returns this Person’s _photos Array.
Adds this Photoset into this Person’s _photosets Array if it isn’t already there
Returns this Person’s _photosets Array.
Adds this Group into this Person’s _groups Array if it isn’t already there
Returns this Person’s _groups Array.
Removes this Photoset into this Person’s _photosets Array
Adds a Tag into this Person’s _tags Array if it isn’t already there
Get’s this persons _tags.
Get’s a Person object for the given nsid.

nsid

public var nsid: String

This person’s nsid.

username

public var username: String

This person’s username.

email

public var email: String

This person’s email address.

iconServer

public var iconServer: Number

Used to build the url to the users’ buddyicon

friend

public var friend: Boolean

If this person is a friend.

family

public var family: Boolean

If this person is family.

ignored

public var ignored: Boolean

If this person is ignored.

isAdmin

If this person is an admin.

isPro

If this person has a Pro account.

realname

public var realname: String

This person’s real name.

location

public var location: String

This person’s location.

mboxSha1sum

public var mboxSha1sum: String

This person’s mboxSha1sum.

numPhotos

public var numPhotos: String

The number of photos this user has taken.

photosFirstDate

public var photosFirstDate: Date

The date this persons first photograph was uploaded.

photosFirstDateTaken

public var photosFirstDateTaken: Date

The date this persons first photograph was taken.

bandwidthMax

public var bandwidthMax: Number

The bandwidth this user has available, in bytes per month.

bandwidthUsed

public var bandwidthUsed: Number

The bandwidth this user has used this month, in bytes.

filesizeMax

public var filesizeMax: Number

The maximum size per file that this user can upload, in bytes.

_photos

private var _photos: Array

An Array containing references to all of this Person’s photos.  Can be filled up bit by bit as a result of calls to e.g.  Flickr.photosGetInfo

_tags

private var _tags: Object

An Object containing references to all of this Person’s Tag’s

_photosets

private var _photosets: Array

An Array containing references to this user’s Photosets

See Also

getPhotosets

addPhotoset

_groups

private var _groups: Array

An Array containing references to this user’s Groups

See Also

getGroups

addGroup

_publicContacts

private var _publicContacts: Object

An Array containing references to all of this Person’s contacts.

See Also

getPublicContacts

addPublicContact

_favorites

private var _favorites: Object

An Array containing references to all of this Person’s favourites as Photo objects indexed by the id of each of the favourites.

See Also

<getFavourites>

<addFavourite>

_people

private static var _people: Object

A private static Object containing Person objects.  Used by getPerson to insure that only one Person is created for each nsid returned from flickr.com

Person

function Person(nsid: String)
Constructor functioncreates a new Person object.

Should be called via <PersonManager.getPerson>

addPublicGroup

function addPublicGroup(group: Group,
isAdmin: Boolean):Void

Add’s a public group to this user and notes whether this user is an admin of that group.

Parameters

groupThe Group you are adding.
isAdminWhether this Person is an admin of this group

See Also

Flickr.peopleGetPublicGroups

getPublicGroups

function getPublicGroups():Array

Gets a list of the public groups that a user is a member of (if Flickr.peopleGetPublicGroups has been called for that user.

TODO

Should this call Flickr.peopleGetPublicGroups automatically if it hasn’t been called?  Probably not because then it would become asyncronous and couldn’t return the result immediately

Returns

An Array of Objects containing two items group (a Group) and isAdmin (a Boolean) which marks whether this Person is an administrator of that Group

See Also

Flickr.peopleGetPublicGroups

addPublicContact

function addPublicContact(contact: Person):Void

Add’s a public contact to this user

Parameters

contactThe Person you are adding.

See Also

Flickr.contactsGetPublicList

getPublicContacts

getPublicContacts

function getPublicContacts():Object

Gets a list of the public contacts that this user has (if addPublicContact has been called for this user.

Returns

An Object containing Person objects indexed by their nsids.

See Also

Flickr.contactsGetPublicList

addPublicContact

addFavorite

function addFavorite(photo: Photo):Void

Adds a favourite Photo to this user.

NOTE, this just updates the internal representation of the user, It doesn’t add the favorite on the flickr website.  See Flickr.favoritesAdd if this is what you want to do.

Parameters

photoThe Photo you are adding.

See Also

Flickr.favoritesGetPublicList

getFavorites

removeFavorite

function removeFavorite(photo: Photo):Void

Removes a favourite Photo from this user.

NOTE, this just updates the internal representation of the user, It doesn’t remove the favorite on the flickr website.  See Flickr.favoritesRemove if this is what you want to do.

Parameters

photoThe Photo you are adding.

See Also

Flickr.favoritesGetPublicList

getFavorites

getFavorites

function getFavorites():Object

Gets a list of the favorite Photo’s that this user has.

Returns

An Object containing Photo objects indexed by their ids.

See Also

Flickr.favoritesGetPublicList

<addFavourite>

addPhoto

function addPhoto(photo: Photo):Void

Adds this Photo into this Person’s _photos Array if it isn’t already there

Parameters

photoThe Photo you are adding.

getPhotos

function getPhotos():Array

Returns this Person’s _photos Array.

Returns

An Array of Photo objects.

addPhotoset

function addPhotoset(photoset: Photoset):Void

Adds this Photoset into this Person’s _photosets Array if it isn’t already there

Parameters

photosetThe Photoset you are adding.

getPhotosets

function getPhotosets():Array

Returns this Person’s _photosets Array.

Returns

An Array of Photoset objects.

clearPhotosets

function clearPhotosets()

addGroup

function addGroup(group: Group):Void

Adds this Group into this Person’s _groups Array if it isn’t already there

Parameters

groupThe Group you are adding.

getGroups

function getGroups():Array

Returns this Person’s _groups Array.

Returns

An Array of Group objects.

removePhotoset

function removePhotoset(photoset: Photoset):Void

Removes this Photoset into this Person’s _photosets Array

Parameters

photosetThe Photoset you are removing.

addTag

function addTag(tag: Tag,
count: Number):Void

Adds a Tag into this Person’s _tags Array if it isn’t already there

Parameters

tagThe Tag you are adding.
countThe number of times this person uses this tag.

getTags

public function getTags():Object

Get’s this persons _tags.

getPerson

public static function getPerson(nsid: String):Person

Get’s a Person object for the given nsid.

Consults _people to make sure that only one Person instance is created for each nsid from flickr.com

Parameters

nsidThe id of the Person you want to get
public var nsid: String
This person’s nsid.
public var username: String
This person’s username.
public var email: String
This person’s email address.
public var iconServer: Number
Used to build the url to the users’ buddyicon
public var friend: Boolean
If this person is a friend.
public var family: Boolean
If this person is family.
public var ignored: Boolean
If this person is ignored.
public var realname: String
This person’s real name.
public var location: String
This person’s location.
public var mboxSha1sum: String
This person’s mboxSha1sum.
public var numPhotos: String
The number of photos this user has taken.
public var photosFirstDate: Date
The date this persons first photograph was uploaded.
public var photosFirstDateTaken: Date
The date this persons first photograph was taken.
public var bandwidthMax: Number
The bandwidth this user has available, in bytes per month.
public var bandwidthUsed: Number
The bandwidth this user has used this month, in bytes.
public var filesizeMax: Number
The maximum size per file that this user can upload, in bytes.
private var _photos: Array
An Array containing references to all of this Person’s photos.
private var _tags: Object
An Object containing references to all of this Person’s Tag’s
Class to describe a tag on a photo on flickr.com
private var _photosets: Array
An Array containing references to this user’s Photosets
Describes a Photoset on flickr.com
private var _groups: Array
An Array containing references to this user’s Groups
Class to describe a group from Flickr.
private var _publicContacts: Object
An Array containing references to all of this Person’s contacts.
private var _favorites: Object
An Array containing references to all of this Person’s favourites as Photo objects indexed by the id of each of the favourites.
Class to describe a photo from Flickr.
private static var _people: Object
A private static Object containing Person objects.
function Person(nsid: String)
function addPublicGroup(group: Group,
isAdmin: Boolean):Void
Add’s a public group to this user and notes whether this user is an admin of that group.
function getPublicGroups():Array
Gets a list of the public groups that a user is a member of (if Flickr.peopleGetPublicGroups has been called for that user.
function peopleGetPublicGroups(nsid: String)
Calls flickr.people.getPublicGroups to get the list of public groups a user is a member of.
function addPublicContact(contact: Person):Void
Add’s a public contact to this user
function getPublicContacts():Object
Gets a list of the public contacts that this user has (if addPublicContact has been called for this user.
function addFavorite(photo: Photo):Void
Adds a favourite Photo to this user.
function removeFavorite(photo: Photo):Void
Removes a favourite Photo from this user.
function getFavorites():Object
Gets a list of the favorite Photo’s that this user has.
function addPhoto(photo: Photo):Void
Adds this Photo into this Person’s _photos Array if it isn’t already there
function getPhotos():Array
Returns this Person’s _photos Array.
function addPhotoset(photoset: Photoset):Void
Adds this Photoset into this Person’s _photosets Array if it isn’t already there
function getPhotosets():Array
Returns this Person’s _photosets Array.
function clearPhotosets()
function addGroup(group: Group):Void
Adds this Group into this Person’s _groups Array if it isn’t already there
function getGroups():Array
Returns this Person’s _groups Array.
function removePhotoset(photoset: Photoset):Void
Removes this Photoset into this Person’s _photosets Array
function addTag(tag: Tag,
count: Number):Void
Adds a Tag into this Person’s _tags Array if it isn’t already there
public function getTags():Object
Get’s this persons _tags.
public static function getPerson(nsid: String):Person
Get’s a Person object for the given nsid.
function photosGetInfo (photoId: Number,
secret: String)
Calls flickr.photos.getInfo to get information about a photo..
public function contactsGetPublicList(nsid: String)
Calls flickr.contacts.getPublicList to get a list of contacts a user.
public function favoritesAdd(photoId: Number)
Calls flickr.favorites.add to add a photo to a user’s favorites list.
public function favoritesGetPublicList(userId: String,
extras: String,
perPage: Number,
page: Number)
Calls flickr.favorites.getPublicList to get a list of favorite public photos for the given user.
public function favoritesRemove(photoId: Number)
Calls flickr.favorites.remove to remove a photo from a user’s favorites list.