WWW::SlideShare
A perl interface to the Slideshare Web Service API
The usage of the API is demonstrated here -
my $ss = WWW::SlideShare->new('api_key' => $api_key, 'secret' => $secret); ok (ref $ss, "Object creation"); my $slide = $ss->get_slideshow({ 'slideshow_id' => 4383743 }); ok($slide->[0]->ID == 4383743, "get_slideshow() by id");
This an object-oriented module and supports most of the SlideShare Web Services API documented at http://www.slideshare.net/developers/documentation
All parameters are passed as key-value pairs in a hash reference.
Creates a SlideShare object, taking two parameters - API key and secret my $obj = new ({ 'api_key' => $api_key, 'secret' => $secret })
This can be called in one of two ways, by providing slideshow_id or slideshow_url. It always returns a slideshow object. $slideshow = get_slideshow({ slideshow_id => $id }) $slideshow = get_slideshow({ slideshow_url => $url })
This accepts a tag and other optional key-value pairs supported by the API, returning a reference to an array of slideshow objects. $slideshows = get_slideshow_by_tag({ tag => $tag, ... })
This accepts username of user whose slideshows are to be accessed and returns a reference to an array of slideshow objects. detailed is an optional parameter $slideshows = get_slideshows_by_user({ 'username_for' => $user, 'detailed' => 0 });
This accepts the keyword/phrase contained in slideshows and returns a reference to an array of slideshow objects. $slideshows = search_slideshows({ 'q' => $keyword, ... });
This accepts a username and returns a reference to an array of SlideShare group objects corresponding to that user. $gps = $ss->get_user_groups({ 'username_for' => $user, ... });
This accepts a username and returns a reference to an array of SlideShare contact objects corresponding to that user. $contacts = $ss->get_user_contacts({ 'username_for' => $user, ... });
This accepts a username and returns a reference to an array of SlideShare tag objects corresponding to that user. $tags = $ss->get_user_tags({ 'username_for' => $user, ... });
If any Web Service error is encountered, then it dies with a stack backtrace and displays the error message returned. The errors may be -
- Network connectivity errors - API key/secret incorrect - User/Slide not found on the system
Example error message:
SlideShare Service Error <?xml version="1.0" encoding="UTF-8"?> <SlideShareServiceError> <Message ID="2">Failed User authentication</Message> </SlideShareServiceError>
The campaign related methods and edit/delete/upload slideshow methods are currently not supported and will be provided in future releases.
Ashish Mukherjee (ashish.mukherjee@gmail.com)
No known ones
This is distributed under the same licence as the perl source code.
June 3, 2010
To install WWW::SlideShare, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::SlideShare
CPAN shell
perl -MCPAN -e shell install WWW::SlideShare
For more information on module installation, please visit the detailed CPAN module installation guide.