Author image Masaru Hoshino
and 1 contributors

NAME

WebService::Hatena::Bookmark::Lite - A Perl Interface for Hatena::Bookmark AtomPub API

SYNOPSIS

    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;

DESCRIPTION

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" })'

METHODS

new

      my $bookmark = WebService::Hatena::Bookmark::Lite->new(
          username  => $username,
          password  => $password,
      );

    Creates and returns a WebService::Hatena::Bookmark::Lite Object.

add

      my $edit_ep = $bookmark->add(
          url     => $url,
          tag     => \@tag_list,
          comment => $comment,
      );

    Add Entry of your Hatena::Bookmark. Return EditURI End Point.

edit

      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.

delete

      my $del_ret = $bookmark->delete(
          edit_ep  => $edit_ep ,
      );

    Delete exist entry of your Hatena::Bookmark.

entry2edit_ep

      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.

getEntry

      my $entry = $bookmark->getEntry(
          edit_ep  => $edit_ep ,
      );

    Get exist entry of your Hatena::Bookmark. Return XML::Atom::Entry Object.

getFeed

      my $feed = $bookmark->getFeed();
    
      print $feed->as_xml;

    Get entries of your Hatena::Bookmark. Return XML::Atom::Feed Object.

REPOS

    http://github.com/masartz/p5-webservice-hatena-bookmark-lite/tree/master

AUTHOR

Masartz <masartz {at} gmail.com>

SEE ALSO

  • 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

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.