Change attrs() for attr() to work with mojo::ua 4.x v0.04
authordiegok <diego@freekeylabs.com>
Wed, 25 Dec 2013 22:14:29 +0000 (23:14 +0100)
committerdiegok <diego@freekeylabs.com>
Wed, 25 Dec 2013 22:14:29 +0000 (23:14 +0100)
Changes
lib/WWW/EZTV.pm
lib/WWW/EZTV/Show.pm

diff --git a/Changes b/Changes
index 44f8f09..5f7b35a 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,9 @@
 {{$NEXT}}
 
 {{$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
     - Retrieve episode link by type (magnet, torrent, direct).
 
 0.02      2012-12-26 00:06:54 Europe/Madrid
index 2bf91dc..f45c083 100644 (file)
@@ -25,7 +25,7 @@ sub _build_shows {
         my $link = $tr->at('td:nth-child(1) a');
         WWW::EZTV::Show->new(
             title  => $link->all_text,
         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
         );
             status => lc($tr->at('td:nth-child(2)')->all_text),
             rating => $tr->at('td:nth-child(3)')->all_text
         );
index 7ab346b..f9c994e 100644 (file)
@@ -28,10 +28,10 @@ sub _build_episodes {
         my $a  = $tr->at('td:nth-child(2) a');
 
         WWW::EZTV::Episode->new(
         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{
             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
             }),
             released => $tr->at('td:nth-child(4)')->all_text,
             show     => $self