|
NAMEWebService::BuzzurlAPI - Buzzurl WebService APIVERSION0.02SYNOPSISuse WebService::BuzzurlAPI; use strict; my $buzz = WebService::BuzzurlAPI->new(email => "your email", password => "your password"); # readers api my $res = $buzz->readers( userid => "your userid" ); if($res->is_success){ my $json = $res->json; # do something }else{ die $res->errstr; } DESCRIPTIONBuzzurl is social bookmark service.For more information on Buzzurl, visit the Buzzurl website. http://buzzurl.jp/. API Reference. http://labs.ecnavi.jp/developer/buzzurl/api/ METHODnewCreate instanceOption: email : your login email(require when add api) password : your login password(require when add api) Example: my $buzz = WebService::BuzzurlAPI->new(email => "your email", password => "your password"); readersGet readers useridOptions: userid : userid(require) Example: my $res = $buzz->readers( userid => "userid" ); if($res->is_success){ foreach my $userid(@{$res->json}){ # do something... } } favoritesGet favorites useridOptions: userid : userid(require) Example: my $res = $buzz->favorites( userid => "userid" ); if($res->is_success){ foreach my $userid(@{$res->json}){ # do something... } } url_infoGet url infoOptions: url : url(require) Example: my $res = $buzz->url_info( url => "http://your.wanted.domain/" ); if($res->is_success){ my $urlinfo = shift @{$res->json}; my $url = $urlinfo->{url}; my $title = $urlinfo->{title}; my $user_num = $urlinfo->{user_num}; foreach my $ref(@{$userinfo->{posts}}){ my $keywords = $ref->{keywords}; my $comment = $ref->{comment}; my $date = $ref->{date}; my $user_name = $ref->{user_name}; } # do something... } bookmark_countGet bookmark countOptions: url : url(require max:30) Example: my $res = $buzz->bookmark_count( url => "http://your.wanted.domain" ); # multiple # my $res = $buzz->bookmark_count( url => [ "http://your.wanted.domain", "http://your.wanted.domain2" ] ); if($res->is_success){ foreach my $ref(@{$res->json}){ my $url = $ref->{url}; my $title = $ref->{title}; my $users = $ref->{users}; # do something... } } user_articlesGet user articlesOptions: userid : userid(require) Example: my $res = $buzz->user_articles( userid => "userid" ); if($res->is_success){ foreach my $ref(@{$res->json}){ my $url = $ref->{url}; my $title = $ref->{title}; my $comment = $ref->{comment}; my $keywords = $ref->{keywords}; # do something... } } recent_articlesGet recent articlesOptions: num : get number(default:5) of : page number(default:0) threshold : bookmark count threshold(default:0) Example: my $res = $buzz->recent_articles( num => 0, of => 1, threshold => 3 ); if($res->is_success){ foreach my $ref(@{$res->json}){ my $url = $ref->{url}; my $title = $ref->{title}; my $user_num = $ref->{user_num}; my $user_id = $ref->{user_id}; my $register_date = $ref->{register_date}; # do something... } } keyword_articlesGet keyword articlesOptions: userid : userid(require) keyword : keyword string(require) Example: my $res = $buzz->keyword_articles( userid => "userid", keyword => "keyword string" ); if($res->is_success){ foreach my $ref(@{$res->json}){ my $url = $ref->{url}; my $title = $ref->{title}; my $user_num = $ref->{user_num}; my $user_id = $ref->{user_id}; my $register_date = $ref->{register_date}; # do something... } } addAdd my bookmark(https + basic auth access)Options: url : bookmark url(require) title : bookmark title comment : bookmark comment keyword : bookmark keyword(max:8) Example: my $res = $buzz->add( url => "http://your.register.domain/", title => "my bookmark title", comment => "my bookmark comment", keyword => "my keyword", # multiple keyword keyword => [ "my keyword", "my keyword2" ], ); if($res->is_success){ print $res->json->{status} . "\n"; }else{ die $res->errstr; } ACCESSOR METHODExample: $buzz->email("your email"); my $email = $buzz->email; passwordGet/Set login passwordExample: $buzz->password("your password"); my $password = $buzz->password; uaGet LWP::UserAgent instance(Readonly)Example: # LWP::UserAgent::timeout $buzz->ua->timeout(30); # LWP::UserAgent::env_proxy $buzz->ua->env_proxy; SEE ALSOClass::Accessor LWP::UserAgent Readonly UNIVERSAL::require URIAUTHORAkira HorimotoCOPYRIGHTCopyright (C) 2007 Akira HorimotoThis module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Visit the GSP FreeBSD Man Page Interface. |