Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added thewb.com!

  • Loading branch information...
commit aba9f63401f6dc37d5136eafaba130877e8d5587 1 parent 6c70b9f
@miyagawa miyagawa authored
View
19 root/plugins/thewb.com/find_enclosures.pl
@@ -0,0 +1,19 @@
+# http://www.thewb.com/shows/veronica-mars/weevils-wobble-but-they-dont-go-down/b1c93370fa
+# http://www.thewb.com/shows/pop_out/b1c93370fa/1
+sub init {
+ my $self = shift;
+ $self->{handle} = '/shows/.*?/[0-9a-f]+$|/shows/pop_out/[0-9a-f]+/';
+}
+
+sub find {
+ my($self, $args) = @_;
+
+ my $id = ($args->{url} =~ m!/([0-9a-z]+)$!)[0] || ($args->{url} =~ m!/shows/pop_out/([0-9a-z]+)/!)[0]
+ or return;
+
+ my $enclosure = Plagger::Enclosure->new;
+ $enclosure->url("http://www.thewb.com/player/wbphasethree/wbvideoplayer.swf?config=wbembedplayer.xml&mediaKey=$id");
+ $enclosure->type('application/x-shockwave-flash');
+
+ return $enclosure;
+}
View
21 root/plugins/thewb.com/scraper.pl
@@ -0,0 +1,21 @@
+# Check 'Skip RSS discovery'
+sub init {
+ my $self = shift;
+ $self->{handle} = '/shows/';
+}
+
+sub build_scraper {
+ scraper {
+ my $current_url;
+ process "title", title => [ 'TEXT', sub { (/Full episodes of (.*?),/)[0] || $_ } ];
+ process "#tab1 div.showlistall", 'entries[]' => scraper {
+ # use the pop_out link since it autostarts
+ my $epinfo;
+ process ".episodeinfo", sub { $epinfo = $_->as_text };
+ process ".episodetitle > .ep_link", title => [ 'TEXT', sub { "$_ $epinfo" } ],
+ link => [ '@id', sub { URI->new("http://www.thewb.com/shows/pop_out/$_/0") } ];
+ process ".episodedesc", body => 'TEXT';
+ process "img", thumbnail => '@src';
+ };
+ };
+}
Please sign in to comment.
Something went wrong with that request. Please try again.