Show
Ignore:
Timestamp:
12/24/07 14:16:43 (5 years ago)
Author:
yasu
Message:

lang/perl/WWW-NicoVideo?:

getNewEntries, getRecentEntries を追加。(NicoVideo?.pm)
ニコニコ動画の仕様変更 (サムネイル画像のXpath) に追従。(Scraper.pm)
timelocalの使い方を間違えていて1月ずれていたのを修正。(Scraper.pm)

Location:
lang/perl/WWW-NicoVideo/trunk/lib/WWW
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/WWW-NicoVideo/trunk/lib/WWW/NicoVideo.pm

    r2197 r3521  
    1111use LWP::UserAgent; 
    1212use HTTP::Cookies; 
    13 use URI; 
    1413use URI::QueryParam; 
    1514use WWW::NicoVideo::Entry; 
     
    103102*getEntriesByKeyword = \&getEntriesByKeywords; 
    104103 
     104sub getNewEntries 
     105{ 
     106  my $self = shift; 
     107  $self->getEntries("newarrival", @_); 
     108} 
     109 
     110*getNewEntry = \&getNewEntries; 
     111 
     112sub getRecentEntries 
     113{ 
     114  my $self = shift; 
     115  $self->getEntries("recent", @_); 
     116} 
     117 
     118*getRecentEntry = \&getRecentEntries; 
     119 
    105120sub getEntries 
    106121{ 
     
    120135  } 
    121136 
    122   my $url = new URI(nicoURL($type, @keys)); 
     137  my $url = nicoURL($type, @keys); 
    123138  $url->query_param_append(sort => $sort) if(defined $sort); 
    124139  $url->query_param_append(order => $order) if(defined $order); 
  • lang/perl/WWW-NicoVideo/trunk/lib/WWW/NicoVideo/Entry.pm

    r2197 r3521  
    4949     return; 
    5050  }; 
     51  $ent->{url} ||= $uri; 
    5152 
    5253  @$self{keys %$ent} = values %$ent; 
  • lang/perl/WWW-NicoVideo/trunk/lib/WWW/NicoVideo/Scraper.pm

    r2189 r3521  
    2929    process('//div[@class="thumb_frm"]', 
    3030            'entries[]' => scraper { 
    31               process('/div/div/div/p/a/img', 
     31              process('/div/div/div[3]/a/img', 
    3232                      imgUrl => '@src', 
    3333                      imgWidth => '@width', 
     
    7979              $postDateTimeStr =~ 
    8080                /(\d+)年(\d+)月(\d+)日\s+(\d+)\D+(\d+)\D+(\d+)/; 
    81               timelocal($6, $5, $4, $3, $2, $1); } 
     81              timelocal($6, $5, $4, $3, $2 - 1, $1 - 1900); } 
    8282           ); 
    8383    process('//div[@id="PAGEBODY"]/div/div/p[3]',