Changeset 5819 for lang/perl/WWW-HatenaDiary
- Timestamp:
- 01/30/08 01:26:09 (5 years ago)
- Location:
- lang/perl/WWW-HatenaDiary/trunk
- Files:
-
- 3 modified
-
Changes (modified) (1 diff)
-
Makefile.PL (modified) (1 diff)
-
lib/WWW/HatenaDiary.pm (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/WWW-HatenaDiary/trunk/Changes
r3939 r5819 1 1 Revision history for Perl extension WWW::HatenaDiary 2 3 0.02 Tue Jan 30 01:18:09 2008 4 - This module now uses WWW::HatenaLogin to login to Hatena::Diary. 5 (Thanks to Yappo++) 6 - Fixed a bug: creating/updating entry fails if diary is under private. 2 7 3 8 0.01 Tue Jan 1 22:45:04 2008 -
lang/perl/WWW-HatenaDiary/trunk/Makefile.PL
r5817 r5819 9 9 JSON::Syck 10 10 /); 11 11 12 requires WWW::HatenaLogin => 0.02; 12 13 -
lang/perl/WWW-HatenaDiary/trunk/lib/WWW/HatenaDiary.pm
r5817 r5819 6 6 use Web::Scraper; 7 7 use WWW::Mechanize; 8 use WWW::HatenaLogin; 8 9 use JSON::Syck 'Load'; 9 use WWW::HatenaLogin;10 10 11 11 our $VERSION = '0.01'; … … 210 210 }); 211 211 212 $self->{login}->mech->get($uri); 213 212 214 scraper { 213 215 process '//div[@class="section"][1]/h3[1]/a[1]', 'uri' => '@href'; 214 216 result 'uri'; 215 }->scrape( URI->new($uri));217 }->scrape($self->{login}->mech->content, URI->new($self->{diary})); 216 218 } 217 219 … … 238 240 }); 239 241 242 # Or just pass a WWW::HatenaLogin object like below if you already have it. 243 # See the POD of it for details 244 my $diary = WWW::HatenaDiary->new({ 245 login => $login # it's a WWW::HatenaLogin object 246 }); 247 240 248 # Check if already logged in to Hatena::Diary 241 249 # If you have a valid cookie, you can omit this process … … 305 313 =head1 METHODS 306 314 307 =head2 new ( [I<\%args>])315 =head2 new ( I<\%args> ) 308 316 309 317 =over 4 … … 319 327 }); 320 328 329 # or... 330 331 my $diary = WWW::HatenaDiary->new({ 332 login => $login # it's a WWW::HatenaLogin object 333 }); 334 335 321 336 Creates and returns a new WWW::HatenaDiary object. If you have a valid 322 337 cookie and pass it into this method as one of C<mech_opt>, you can … … 328 343 with your diary on Hatena::Group. 329 344 330 C<mech_opt> field is alsooptional. You can use it to customize the345 C<mech_opt> field is optional. You can use it to customize the 331 346 behavior of this module in the way you like. See the POD of 332 347 L<WWW::Mechanize> for more details. 348 349 C<login> field is also optional. If you already have a 350 L<WWW::HatenaLogin> object, you can use it to communicate with 351 Hatena::Diary after just passing it as the value of the field. See the 352 POD of L<WWW::HatenaLogin> for more details. 333 353 334 354 =back … … 510 530 L<http://d.hatena.ne.jp/> 511 531 532 =item * L<WWW::HatenaLogin> 533 512 534 =item * L<WWW::Mechanize> 513 535 … … 516 538 =head1 ACKNOWLEDGMENT 517 539 518 typester++ for some codes copied from Fuse::Hatena. 540 typester++ for some codes copied from L<Fuse::Hatena>. 541 542 Yappo++ for improving this module using L<WWW::HatenaLogin> 519 543 520 544 =head1 AUTHOR
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)