From: diegok Date: Wed, 25 Dec 2013 22:14:29 +0000 (+0100) Subject: Change attrs() for attr() to work with mojo::ua 4.x X-Git-Tag: v0.04^0 X-Git-Url: http://git.cascardo.info/?p=cascardo%2Fwww-eztv.git;a=commitdiff_plain;h=072be1f99c866dce6919f6d8aead73bbdabbddf6 Change attrs() for attr() to work with mojo::ua 4.x --- diff --git a/Changes b/Changes index 44f8f09..5f7b35a 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ {{$NEXT}} + - Code updated for Mojo:UserAgent 4.X + +0.03 2012-12-26 00:47:20 Europe/Madrid + - Retrieve episode link by type (magnet, torrent, direct). 0.02 2012-12-26 00:06:54 Europe/Madrid diff --git a/lib/WWW/EZTV.pm b/lib/WWW/EZTV.pm index 2bf91dc..f45c083 100644 --- a/lib/WWW/EZTV.pm +++ b/lib/WWW/EZTV.pm @@ -25,7 +25,7 @@ sub _build_shows { my $link = $tr->at('td:nth-child(1) a'); WWW::EZTV::Show->new( title => $link->all_text, - url => $self->url->clone->path($link->attrs('href')), + url => $self->url->clone->path($link->attr('href')), status => lc($tr->at('td:nth-child(2)')->all_text), rating => $tr->at('td:nth-child(3)')->all_text ); diff --git a/lib/WWW/EZTV/Show.pm b/lib/WWW/EZTV/Show.pm index 7ab346b..f9c994e 100644 --- a/lib/WWW/EZTV/Show.pm +++ b/lib/WWW/EZTV/Show.pm @@ -28,10 +28,10 @@ sub _build_episodes { my $a = $tr->at('td:nth-child(2) a'); WWW::EZTV::Episode->new( - title => $a->attrs('title'), - url => $self->url->clone->path($a->attrs('href')), + title => $a->attr('title'), + url => $self->url->clone->path($a->attr('href')), links => $tr->find('td:nth-child(3) a')->map(sub{ - WWW::EZTV::Link->new( url => shift->attrs('href') ) + WWW::EZTV::Link->new( url => shift->attr('href') ) }), released => $tr->at('td:nth-child(4)')->all_text, show => $self