The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Buzznet::API - A Buzznet Photocommunication Client

SYNOPSIS

        use Buzznet::API;

        # Create the buzznet object with the developer key
        # attained at http://www.buzznet.com/developers 

        my $buzznet = Buzznet::API->new( key => "1234567890",
                                         username => "developer",
                                         password => "password");

        # Leave category blank for default
        my $postId = $buzznet->newPost($filepath, $caption, $body, $category);

DESCRIPTION

    Provides an easy to use interface for calling the Buzznet Photocommunications API.

METHODS

new( OPTIONS )

The constructor that returns a blessed reference to the Buzznet::API instance. See the SYNOPSIS for a sample usage.

url( )

Returns the XML-RPC url to the Buzznet API.

sendRequest( method_name, [ ARGS ] )

Calls an XML-RPC method on the Buzznet API url with the given ARGS. ARGS must be valid RPC::XML types. This method should only be used for undocumented API methods, since most of the functionality is already defined by other methods in this class.

Returns either an error, or the RPC::XML response value.

error( )

Returns the most recent error. This should be checked if a call to any of the API methods, or sendRequest returns 0.

newPost( filename, caption, body, category )

Posts a new image to Buzznet. The filename must point to a valid image file. The category can be an empty string or a subgallery name.

On success, returns the newly created post id; returns 0 on failure

editPost( entry_id, filename, caption, body, category )

Updates an existing image post. The entry_id must be owned by the logged in user. The filename must point to a valid image file The category can be an empty string or subgallery name

On success, returns the newly created post id; returns 0 on failure

removePost( entry_id )

Removes an image post. The entry_id must be owned by the logged in user.

getEntry( entry_id, type )

Gets a Buzznet entry for the specified entry_id. Type can be either "user" or "cat.

Returns a Buzznet::Entry object on success, or 0 on failure.

addGallery( name, title, description, keyword, password )

Creates a user subgallery. The name of the gallery will later be used as part of the url (e.g. http://kevin-testgallery.buzznet.com/); therefore, the name can only contain letters and numbers. The title is a more verbose representation of the gallery, and will displayed on the welcome page of the gallery. The keyword is public keyword that can be left empty. Populating this field will allow other's to post to this gallery via email using this keyword wihtout knowing the user's password. The password for the gallery. It can (and should) be left empty. Allows for password-protection on a gallery so only authenticated users with that password can view the photos.

On success, returns the newly created gallery ID, on failure returns 0

editGallery( name, title, description, keyword, password )

Edits a user subgallery. The same functionality as the addGallery method, except on an existing subgallery.

On success, returns the gallery ID, on failure returns 0

removeGallery( name )

Removes a user subgallery. This causes all the images that were previously in this gallery to be placed back into the main default gallery. The gallery_name must be owned by the logged in user.

Returns 1 on success, 0 on failure.

getSubGalleries( username )

Retrieves a list of subgalleries for a particular user.

Returns an array of Buzznet::Gallery objects on success, or a 0 on failure.

getGallery( username, type, user_cat, current_page, pagesize )

Get images from a user or community gallery or user subgallery. The type can be "user" or "cat". If the type is "user", the user_cat can specify a subgallery, otherwise user_cat can be left empty. The current_page is a zero based index into the gallery. The pagesize is the number of images to be returned per page.

Returns an array of Buzznet::Entry objects on success, or a 0 on failure.

getRecentPosts( type )

Gets the last 12 recent posts from communities or users. The type can be either "user" or "cat".

Returns an array of Buzznet::Entry objects on success, or a 0 on failure.

getComments( entry_id, type )

Gets a list of comments for a given image. The type can be either "user" or "cat".

Returns an array of Buzznet::Comment objects on success, or a 0 on failure.

addComment( entry_id, comment, type )

Adds a comment to a user or community post. The type can be either "user" or "cat".

Returns the unique ID of the comment on success, 0 on failure.

removeComment( comment_id )

Removes a comment from a user or cateogry post.

Returns a 1 on success, 0 on failure.

getRecentComments( username )

Get comments on the given usernames blog from the past 48 hours.

Returns an array of Buzznet::Comment objects, 0 on failure.

addBuzzwords( entry_id, buzzwords, type )

Add a Buzzword to a post. The buzzwords parameter is a comma-separated string of image keywords. The type can be either "user" or "cat".

removeBuzzwords( entry_id, buzzword )

Removes a Buzzword from an image post.

Returns 1 on success, 0 on failure.

getBuzzword( buzzword, pagesize, page_number )

Gets the images associated with a given buzzword. The pagesize is the number of images to return, the page_number is the index of the page.

Returns an array of Buzznet::Entry objects on success, or 0 on failure

browseBuzzwords( number_of_buzzwords )

Gets a list of recent Buzzwords.

Returns an array of Buzznet::Buzzword objects on success, 0 on failure.

updateProfile( profile )

Updates the basic profile information of the logged in user. The profile is a populated Buzznet::Profile object.

addFriend( username, order )

Add a user to the friends list of the logged in user. The order is the position this friend should be in the friends list.

removeFriend( username )

Removes a friend from the friends list of the logged in user.

getMyFriends( )

Gets a list of friends for the logged in user.

Returns an array of Buzznet::Profile objects on success, 0 on failure.

getFriends( user_id )

Gets a list of friends for the user specified by the user_id.

Returns an array of Buzznet::Profile objects on success, 0 on failure.

getFriendsRecent( user_id )

Gets a list of the most recent entries from the provided user's friends list.

Returns an array of Buzznet::Entry objects on success, 0 on failure.

addBookmark( entry_id, type, order )

Adds a bookmark of the entry id to the logged in users profile. Type can be either "user" or "cat". The order specifies where to place this in respect to the other bookmarks

Returns the newly created bookmark_id on success, 0 on failure

removeBookmark( entry_id, type )

Removes the specified bookmark for the logged in user. The type can be either "user" or "cat".

Returns 1 on success, 0 on failure

getBookmarks( )

Gets a list of the logged in user's bookmarked entries.

Returns an array of Buzznet::Entry objects on success, 1 on failure.

getMostPopular( type )

Gets the top 10 most popular user or community posts of the week. Type can be either "user" or "cat".

Returns an array of Buzznet::Entry objects on success, 1 on failure.

getTodaysBirthdays( )

Gets a list of users whose birthday is the current day.

Returns an array of Buzznet::Profile objects on success, 1 on failure.

getOnlineNow( )

Gets information about last 10 users who are signed in on Buzznet.com

Returns an array of Buzznet::Profile objects on success, 1 on failure.

getFeaturedUsers( number_of_users )

Gets a list of users that have been hand-selected as featured users on Buzznet.

Returns an array of Buzznet::Profile objects on success, 1 on failure.

SEE ALSO

Check out http://www.buzznet.com/developers for the latest tools and libraries available for all languages and platforms. The complete XML-RPC Buzznet API can be found at http://www.buzznet.com/developers/apidocs/.

Buzznet::Entry Buzznet::Comment Buzznet::Profile Buzznet::Buzzword

AUTHOR

Kevin Woolery, <kevin@buzznet.com>

COPYRIGHT AND LICENSE

Copyright (C) 2004 by Kevin Woolery

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.5 or, at your option, any later version of Perl 5 you may have available.