X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=lib%2FWWW%2FEZTV.pm;h=afce7cb653a0db719471379c5e1b4f35b1e402e5;hb=ec38c42af7b0214b09dfc67d54fcf2e814ba2227;hp=2bf91dcdff5aa0b8f63448a59f6087d2afdea0e2;hpb=17802f254b869064461d14e6a2fb015b59246a46;p=cascardo%2Fwww-eztv.git diff --git a/lib/WWW/EZTV.pm b/lib/WWW/EZTV.pm index 2bf91dc..afce7cb 100644 --- a/lib/WWW/EZTV.pm +++ b/lib/WWW/EZTV.pm @@ -1,14 +1,15 @@ package WWW::EZTV; + use Moose; with 'WWW::EZTV::UA'; use WWW::EZTV::Show; # ABSTRACT: EZTV scrapper -has url => ( is => 'ro', lazy => 1, default => sub { Mojo::URL->new('http://eztv.it/') } ); +has url => ( is => 'ro', lazy => 1, default => sub { Mojo::URL->new('https://eztv.ch/') } ); has url_shows => ( is => 'ro', lazy => 1, default => sub { shift->url->clone->path('/showlist/') } ); -has shows => +has shows => is => 'ro', lazy => 1, builder => '_build_shows', @@ -20,14 +21,14 @@ has shows => sub _build_shows { my $self = shift; - $self->get_response( $self->url_shows )->dom->find('table.forum_header_border tr[name="hover"]')->map(sub { + $self->get_response( $self->url_shows )->dom->find('table.header_brd tr[name="hover"]')->map(sub { my $tr = shift; - my $link = $tr->at('td:nth-child(1) a'); + my $link = $tr->at('td:nth-child(2) a'); WWW::EZTV::Show->new( title => $link->all_text, - url => $self->url->clone->path($link->attrs('href')), - status => lc($tr->at('td:nth-child(2)')->all_text), - rating => $tr->at('td:nth-child(3)')->all_text + url => $self->url->clone->path($link->attr('href')), + status => lc($tr->at('td:nth-child(3)')->all_text), + rating => $tr->at('td:nth-child(4)')->text + 0 ); }); }