WebService::Hatena::Bookmark::Lite - A Perl Interface for Hatena::Bookmark AtomPub API
use WebService::Hatena::Bookmark::Lite; my $bookmark = WebService::Hatena::Bookmark::Lite->new( username => $username, password => $password, ); ### add my $edit_ep = $bookmark->add( url => $url, tag => \@tag_list, comment => $comment, ); ### edit @tag = ( qw/ kaka tete /); $com = 'edit comment'; $bookmark->edit( edit_ep => $edit_ep, tag => \@tag , comment => $com , ); ### delete $bookmark->delete( edit_ep => $edit_ep , ); # Get Feed my $feed = $bookmark->getFeed(); print $feed->as_xml;
WebService::Hatena::Bookmark::Lite provides an interface to the Hatena::Bookmark AtomAPI.
If you use this module , It is necessary to prepare Hatena ID beforehand.
Hatena ID & password are necessary , when you install this module too. please set ID & password using Conig::Pit , it looks like this.
% perl -MConfig::Pit -e'Config::Pit::set("http://www.hatena.ne.jp", data=>{ username => "foobar", password => "barbaz" })'
my $bookmark = WebService::Hatena::Bookmark::Lite->new( username => $username, password => $password, );
Creates and returns a WebService::Hatena::Bookmark::Lite Object.
my $edit_ep = $bookmark->add( url => $url, tag => \@tag_list, comment => $comment, );
Add Entry of your Hatena::Bookmark. Return EditURI End Point.
my $edit_ret = $bookmark->edit( edit_ep => $edit_ep, tag => \@tag_list, comment => $comment, );
Edit exist entry of your Hatena::Bookmark. Return true on success, false otherwise.
my $del_ret = $bookmark->delete( edit_ep => $edit_ep , );
Delete exist entry of your Hatena::Bookmark.
my $edit_ep = $bookmark->entry2edit_ep( $entry );
Need one parameter. what is XML::Atom::Entry Object. Return EditURI End Point of correct entry. EditURI End Point is unique number of each entry.
my $entry = $bookmark->getEntry( edit_ep => $edit_ep , );
Get exist entry of your Hatena::Bookmark. Return XML::Atom::Entry Object.
my $feed = $bookmark->getFeed(); print $feed->as_xml;
Get entries of your Hatena::Bookmark. Return XML::Atom::Feed Object.
http://github.com/masartz/p5-webservice-hatena-bookmark-lite/tree/master
Masartz <masartz {at} gmail.com>
Hatena-Bookmark
http://b.hatena.ne.jp/
Hatena-Bookmark API documentation
http://d.hatena.ne.jp/keyword/%A4%CF%A4%C6%A4%CA%A5%D6%A5%C3%A5%AF%A5%DE%A1%BC%A5%AFAtomAPI
XML::Atom
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install WebService::Hatena::Bookmark::Lite, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebService::Hatena::Bookmark::Lite
CPAN shell
perl -MCPAN -e shell install WebService::Hatena::Bookmark::Lite
For more information on module installation, please visit the detailed CPAN module installation guide.