Retrive episode links by type and some more docs
[cascardo/www-eztv.git] / lib / WWW / EZTV.pm
index c62f236..2bf91dc 100644 (file)
@@ -32,22 +32,28 @@ sub _build_shows {
     });
 }
 
-=head1 SYNOPSIS
+1;
 
-First create a WWW::EZTV object to navigate.
+=head1 SYNOPSIS
 
     use WWW::EZTV;
+    use v5.10;
 
     my $eztv = WWW::EZTV->new;
 
+    # Find one show
     my $show = $eztv->find_show(sub{ $_->name =~ /Walking dead/i });
 
+    # Find one episode
     my $episode = $show->find_episode(sub{ 
         $_->season == 3 && 
         $_->number == 8 && 
         $_->quality eq 'standard' 
     });
 
+    # Get first torrent url for this episode
+    say $episode->find_link(sub{ $_->type eq 'torrent' })->url;
+
 =attr url
 
 EZTV URL.
@@ -88,4 +94,6 @@ L<https://github.com/diegok/www-eztv>
 
 Pull requests are also very welcomed, but please include tests demostrating
 what you've fixed.
-1;
+
+=cut
+