Hi!
I have find problems with the flex flickr API and i i have fix all,
but i would share my experiment to help you to improve the API.
First, i have try to use date taken filter to search photos with the
Api and i have seen that the api send time value instead of mysql date
style. So the search doesn't work with date taken filter.
I have seen that there was "sign" doubloons problem when using
"auth.checkToken" webservice. (i have fix it with a bad hack via using
a check doobloons method).
I have seen that the farm id is missing when i use 'photo.search' web
service : (miss in photo class too)
internal static function parsePagedPhotoList( xml:XML ):PagedPhotoList
{
var pagedPhotoList:PagedPhotoList = new PagedPhotoList();
pagedPhotoList.page = parseInt( xml.photos.@page );
pagedPhotoList.pages = parseInt( xml.photos.@pages );
pagedPhotoList.perPage = parseInt( xml.photos.@perpage );
pagedPhotoList.total = parseInt( xml.photos.@total );
var photos:Array = new Array();
for each ( var p:XML in xml.photos.photo ) {
var photo:Photo = new Photo();
photo.notes = new Array();
photo.notes[0] = p.@farm.toString(); // hack to get the farm id
photo.id = p.@id.toString();
photo.ownerId = p.@owner.toString();
photo.secret = p.@secret.toString();
photo.server = parseInt( p.@server );
photo.title = p.@title.toString();
photo.isPublic = p.@ispublic.toString() == "1";
photo.isFriend = p.@isfriend.toString() == "1";
photo.isFamily = p.@isfamily.toString() == "1";
if ( p.@license.toString() ) {
photo.license = parseInt( p.@license );
}
photo.dateUploaded = stringToDate( p.@dateupload.toString() );
photo.dateTaken = stringToDate( p.@datetaken.toString() );
photo.dateAdded = stringToDate( p.@dateadded.toString() );
photo.ownerName = p.@ownername.toString();
if ( p.@iconserver.toString() ) {
photo.iconServer = parseInt( p.@iconserver );
}
photo.originalFormat = p.@originalformat.toString();
photos.push( photo );
}
pagedPhotoList.photos = photos;
return pagedPhotoList;
}
Finally i have added "photos.geo.setLocation" and
"flickr.photos.geo.getLocation" methods.
public function getLocation( photo_id:String ):void {
// Let the Helper do the work to invoke the method
MethodGroupHelper.invokeMethod( _service, getLocationResult,
"flickr.photos.geo.getLocation",
false,
new NameValuePair( "photo_id", photo_id ) );
}
// from the URLLoader which correspondes to the result from the
API call
MethodGroupHelper.processAndDispatch( _service,
URLLoader( event.target ).data,
result,
"photoLocation",
NXMethodGroupHelper.parsePhotoLocation );
}
public function setLocation( photo_id:String, lat:Number,
lon:Number, accuracy:Number = 1 ):void {
// Let the Helper do the work to invoke the method
MethodGroupHelper.invokeMethod( _service, setLocation_result,
"flickr.photos.geo.setLocation",
false,
new NameValuePair( "photo_id", photo_id ),
new NameValuePair( "lat", lat.toString()),
new NameValuePair( "lon", lon.toString() ),
new NameValuePair( "accuracy", accuracy.toString() ) );
}
I hope that it will help you to improve the existing API.
Best regards,
Damien Corzani