WWW::CheckPad - An API to control the check*pad (http://www.checkpad.jp/)
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();
WWW::CheckPadはcheck*pad(http://www.checkpad.jp/)をプログラムから操作する ことを可能にするAPIです。ログインを正常に行う為に、あらかじめcheck*padで アカウントを用意する必要があります(アカウントの作成等はcheck*padのサイトを 見てください。)。
なお、全体を理解するためにWWW::CheckPad::CheckListとWWW::CheckPad::CheckItem も必ずお読みください。
WWW::CheckPad::CheckList
WWW::CheckPad::CheckItem
my $connection = WWW::CheckPad->connect({ email => 'your email address', password => 'your password' })
WWW::CheckPad::CheckListやWWW::CheckPad::CheckItemのメソッドを呼ぶ前に必ず、 このメソッドでログインを完了させなくてはいけません。ログインが成功したか どうかは、後に説明するhas_logged_inメソッドで判断できます。
has_logged_in
WWW::CheckPad->disconnect();
接続を解除します。これを呼んだ後はWWW::CheckPad::CheckListやWWW::CheckPad::CheckItem のメソッドを使用する事は出来ません。
$connection->has_logged_in()
connectメソッドでログインが正常に完了したときは、trueを、 そうでないときはfalseを返します。
connect
Ken Takeshige, <ken.takeshige@gmail.com>
http://d.hatena.ne.jp/ya_ken/
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.
To install WWW::CheckPad, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::CheckPad
CPAN shell
perl -MCPAN -e shell install WWW::CheckPad
For more information on module installation, please visit the detailed CPAN module installation guide.