NAME
Net::BobrDobr - module for using http://bobrdobr.ru.
SYNOPSIS
use Net::BobrDobr;
my $bd = new Net::BobrDobr (...);
$bd->connect (...) or die $bd->error;
my $ret = $bd->call (...);
DESCRIPTION
This module intended for deplouing social bookmark network http://BobrDobr.ru. You can log in to site, retrieve bookmarks, add bokmarks and remove bookmarks (list of all available operations you can find at http://bobrdobr.ru/api.html).
METHODS
- new()
-
Create new instance of this module. Parameters for this call:
- 'api' => $file
-
File with bobrdobr-api keys, in format
api-key: <api application key> api-secret: <api secret key>
- 'api-key' => $api_key
-
Manually supplied bobrdobr api application key.
- 'api-secret' => $api_secret
-
Manually supplied bobrdobr api secret key.
- 'agent' => $agent
-
Agent name for client, may be omitted.
- 'timeout' => $timeout
-
Timeout, default is 60 secs.
-
File for saving authentification cookies.
Returns
undef
if unsuccess, and$self
if success. - connect()
-
This method perform all authentification operations. It got only two parameters -- login and password:
$bd->connect ($login,$password);
Returns
undef
if unsuccess, and$self
if success. - call()
-
Main method for call bobrdobr-services. List of all available methods you can find in http://bobrdobr.ru/api.html.
First argument or this method is a name of bobrdobr operation, as a
"test.echo"
, and rest -- hash of named parameters for this operations. E.g.:my $ret = $bd->call ("test.echo",'param1' => "one");
Return reference to hash from server, or empty if request fail.
Main field for return hash:
$ret-
{'stat'}>, it may be:"ok"
if operation success, or"fail"
in other case. Full description see in http://bobrdobr.ru/api.html. - plaincall()
-
It is same method as call, but return raw content from server (REST XML form).
SEE ALSO
http://bobrdobr.ru/api.html, XML::Simple, LWP::UserAgent.
AUTHOR
Artur Penttinen, <artur+perl@niif.spb.su>
COPYRIGHT AND LICENSE
Copyright (C) 2008 by Artur Penttinen
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.