NAME

WWW::NicoVideo - Perl interface to Nico Nico Video service

SYNOPSIS

use utf8;
use WWW::NicoVideo;
binmode STDOUT, ":encoding(euc-jp)";

my $nv = new WWW::NicoVideo(mail => 'ritsuko@ritsuko.org',
                            passwd => "ritchan-wa-kawaiidesuyo");
$nv->login or die "Login failed";

my @entries = $nv->getEntriesByTagNames("律子ソロ") or die "get failed";
foreach my $e (@entries) {
  print $e->title, "\n";
}

DESCRIPTION

This module allows you to get information from Nico Nico Video service (http://www.nicovideo.jp/) and also allows you to search from it.

METHODS

$nv = new WWW::NicoVideo(%OPTS)

Constructs a new WWW::NicoVideo object and returns it. Key/value pair options may be provided to set the default value. Following options are accepted:

agent / cookies

LWP::UserAgent / HTTP::Cookies object.

retry / retryInterval

Retry count / retry interval in second. As Nico Nico Video rejects mass access, you have to give appropriate interval between accesses.

mail / passwd

Mail address / password to access Nico Nico Video.

All options except "cookies" can be accessed via accessor methods. (e.g. $nv->agent) You may access cookies via "agent". (e.g. $nv->agent->cookie_jar)

$nv->login

Login to Nico Nico Video. You have to call this method before calling getEntries* methods;

$nv->getEntriesByTagNames(%OPTS) / $nv->getEntriesByKeywords(%OPTS)

Returns entry list for given tag name(s) / keyword(s). In scalar context, this method returns a reference to array of WWW::NicoVideo::Entry or undef on errors. In list context, this method returns list of WWW::NicoVideo::Entry or null list on errors. Following options are accepted:

key / keys

Tagname(s) or keyword(s). "key" takes a scalar value, "keys" takes a reference to array.

page

Page number.

sort

Sort type. "f" for post date, "v" for number of views, "r" for number of comments, undef for last comment date.

order

Sort order. "a" for ASC, "d" or undef for DESC.

SEE ALSO

perl(1), Web::Scraper, WWW::NicoVideo::Entry

AUTHOR

HIRATA Yasuyuki, <yasu@REMOVE-THIS-PART.asuka.net>

COPYRIGHT AND LICENSE

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.8 or, at your option, any later version of Perl 5 you may have available.