PageRenderTime 7ms CodeModel.GetById 1ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/script/setup-pit.pl

http://github.com/motemen/Teto
Perl | 27 lines | 22 code | 4 blank | 1 comment | 2 complexity | d390aeaac35cef936b98fa2400493a53 MD5 | raw file
 1#!/usr/bin/env perl
 2use strict;
 3use warnings;
 4use Config::Pit;
 5use WWW::NicoVideo::Download;
 6
 7my $config = pit_get('nicovideo.jp', require => {
 8    username => 'email/username',
 9    password => 'password',
10});
11my $client = WWW::NicoVideo::Download->new(
12    email    => $config->{username},
13    password => $config->{password},
14);
15
16eval {
17    $client->login('sm14');
18};
19
20if ($@) {
21    warn "$@\n";
22    print "Login failed; please check your config\n";
23} else {
24    print "Login succeeded\n";
25}
26
271;