Net::AozoraBunko - Perl Interface for accessing 青空文庫
use Net::AozoraBunko; $ab = Net::AozoraBunko->new; $authors = $ab->authors; $author = shift @{$authors}; $author_info = $ab->author($author->{url}); $works = $ab->works($author->{url}); $all_works = $ab->works($author->{url}); $text = $ab->get_text($works->[0]->{url}); $zip = $ab->get_zip($works->[0]->{url}); $search_author_results = $ab->search_author('search_word'); $search_work_results = $ab->search_work($author->{url}, 'search_word');
The Aozora Bunko (青空文庫) is the Internet electronic library where consideration is not requested from use. The one assumed to be work that the copyright disappears and "Do not care freely reading" is arranged by TEXT and XHTML (Part is HTML) forms.
Net::AozoraBunko is Perl Interface for accessing 青空文庫. This way it's possible to search authors and download TEXT.
Net::AozoraBunko
my $ab = Net::AozoraBunko->new; my $ab = Net::AozoraBunko->new({ ua => LWP::UserAgent->new(timeout => 15) });
Creates a new Net::AozoraBunko object.
my $authors = $ab->authors;
get authors list
my $author_info = $ab->author($author->{url});
get author's data
my $works = $ab->works($author->{url});
get author's works list
my $all_works = $ab->works($author->{url});
get author's all works list. The one under work is contained
my $text = $ab->get_text($works->[0]->{url});
get a text
my $zip = $ab->get_zip($works->[0]->{url});
get a text by zip
my $search_author_results = $ab->search_author('search_word');
search authors by a keyword
my $search_work_results = $ab->search_work($author->{url}, 'search_word');
search works by a keyword from authors page.
get/set user agent object
Net::AozoraBunko is hosted on github http://github.com/bayashi/Net-AozoraBunko
Dai Okabayashi <bayashi@cpan.org>
http://www.aozora.gr.jp/
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
To install Net::AozoraBunko, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::AozoraBunko
CPAN shell
perl -MCPAN -e shell install Net::AozoraBunko
For more information on module installation, please visit the detailed CPAN module installation guide.