NOTE: As of January 1, 2009, AOL is discontinuing their AOL Pictures service. As such, this class should be used for educational purposes only and will not continue to be supported.
AOL Pictures Class is a PHP class I wrote to interface with the AOL Pictures API posted on dev.aol.com. Each method of the API has been written into a class method that returns PHP friendly results in the form of associative arrays. Some of the features of the API, and thus of this class, include:
For a complete list of API features, please check the documentation and examples at http://dev.aol.com/aol_pictures. In order to use the AOL Pictures API used by this class, you will need to do the following:
<php
// Include this file.
include('pictures.php');
// Instantiate the class.
$pictures = new aolPictures();
//Print a list of no more than 10 tags used by "Chatting Chuck."
print_r($pictures->getPublicTagsByUser('chattingchuck', 10));
//Print a full list of all public photos tagged with either "snow" or "outdoors."
print_r($pictures->getTaggedPublicPhotos('snow,outdoors'));
?>
Included in this package is the User Picture Info class. This class is an extension of aolPictures and serves to create an object with well organized data on a given user's public album.
Important Note: This class makes an API call for each tag the given user has used. This means the calls may be quite extensive for some users, resulting in long execution time and a higher than expected number of API calls. Depending on the usage, it may be a good idea to cache the data contained in this class rather than calling it multiple times for the same user.
There are no methods aside from the contructor. Once instantiated, this class will contain the following information:
<php
// Include this file.
include('pictures.php');
// Instantiate the class, passing the user name.
$pictures = new userPictureInfo('chattingchuck');
//Print a dump of Chatting Chuck's public album data.
print_r($pictures->album));
//Display the total number of pictures in Chatting Chuck's public album.
echo $pictures->user . "has" . $pictures->pictureCount . "photos in his album.";
?>
| Version | Release Date | Release Notes | Download |
|---|---|---|---|
| 0.9 | October 11, 2007 | This is the first release of this class, so it is bound to be buggy. If you find any bugs or have any suggestions for improvements, please feel free to contact me at Nick@LaPrell.org. |