The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

WWW::CheckPad - An API to control the check*pad (http://www.checkpad.jp/)

SYNOPSIS

  use WWW::CheckPad;
  use WWW::CheckPad::CheckList;
  use WWW::CheckPad::CheckItem;

  ## check*padに接続し、ログインします。
  WWW::CheckPad->connect({
    email => 'your email address',
    password => 'your password'
  });

  ## 新しいチェックリストを作成し、保存します。
  my $new_checklist = WWW::CheckPad::CheckList->insert({
      title => 'Private Todo List'
  });

  ## 新しいチェックリストに新しいTodoを追加します。
  my $cut_my_nail = $new_checklist->add_checkitem('Cut my nail.');
  my $buy_a_cat_food = $new_checklist->add_checkitem('Buy a cat food.');

  ## ... 数分後 ...

  ## OK, 爪は切ったぞ。
  $cut_my_nail->finish();

  ## あ! そういえば、私が飼ってるのは猫ではなく、犬だった。
  $buy_a_cat_food->title('Buy a dog food');
  $buy_a_cat_food->update();

  ## 今、終了してない全Todoを見なくちゃ。
  foreach my $checklist (WWW::CheckPad::CheckList->retrieve_all) {
      foreach my $checkitem (grep {not $_->is_finished} $checklist->checkitems) {
          printf "[%s] %s\n", $checklist->title, $checkitem->title;
      }
  }

  ## 接続を切るのはいつだって、良い習慣なのです。
  WWW::CheckPad->disconnect();

DESCRIPTION

WWW::CheckPadはcheck*pad(http://www.checkpad.jp/)をプログラムから操作する ことを可能にするAPIです。ログインを正常に行う為に、あらかじめcheck*padで アカウントを用意する必要があります(アカウントの作成等はcheck*padのサイトを 見てください。)。

なお、全体を理解するためにWWW::CheckPad::CheckListWWW::CheckPad::CheckItem も必ずお読みください。

CLASS METHOD

WWW::CheckPad->connect

  my $connection = WWW::CheckPad->connect({
    email => 'your email address',
    password => 'your password'
  })

WWW::CheckPad::CheckListやWWW::CheckPad::CheckItemのメソッドを呼ぶ前に必ず、 このメソッドでログインを完了させなくてはいけません。ログインが成功したか どうかは、後に説明するhas_logged_inメソッドで判断できます。

WWW::CheckPad->disconnect

  WWW::CheckPad->disconnect();

接続を解除します。これを呼んだ後はWWW::CheckPad::CheckListやWWW::CheckPad::CheckItem のメソッドを使用する事は出来ません。

INSTANCE METHOD

has_logged_in

  $connection->has_logged_in()

connectメソッドでログインが正常に完了したときは、trueを、 そうでないときはfalseを返します。

SEE ALSO

WWW::CheckPad::CheckList

WWW::CheckPad::CheckItem

AUTHOR

Ken Takeshige, <ken.takeshige@gmail.com>

http://d.hatena.ne.jp/ya_ken/

COPYRIGHT AND LICENSE

Copyright (C) 2006 by Ken Takeshige

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.