tidy.
[clive.git] / lib / clive / Host / Buzzhumor.pm
bloba8ad05bbdac08274a41bdbfaf183aac0a274805a
1 # -*- coding: ascii -*-
2 ###########################################################################
3 # clive, command line video extraction utility.
5 # Copyright 2010 Toni Gundogdu.
7 # clive is free software: you can redistribute it and/or modify it under
8 # the terms of the GNU General Public License as published by the Free
9 # Software Foundation, either version 3 of the License, or (at your option)
10 # any later version.
12 # clive is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
15 # details.
17 # You should have received a copy of the GNU General Public License along
18 # with this program. If not, see <http://www.gnu.org/licenses/>.
19 ###########################################################################
20 package clive::Host::Buzzhumor;
22 use warnings;
23 use strict;
25 sub new {
26 return bless( {}, shift );
29 sub parsePage {
30 my ( $self, $content, $props ) = @_;
32 $$props->video_host("buzzhumor");
34 my %re = (
35 id => qr|/videos/(\d+)/|,
36 lnk => qr|&file=(.*?)"|
39 my $tmp;
40 if ( clive::Util::matchRegExps( \%re, \$tmp, $content ) == 0 ) {
42 $$props->video_id( $tmp->{id} );
43 $$props->video_link( $tmp->{lnk} );
45 return (0);
48 return (1);