Tweak modelines
[www-quvi.git] / examples / query_media.pl
blob9b21ee4a92526032849b3119dff21ca4b3f61bf8
1 #!/usr/bin/env perl
3 # WWW::Quvi
4 # Copyright (C) 2011 Toni Gundogdu <legatvs@gmail.com>
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License
8 # as published by the Free Software Foundation; either version 2
9 # of the License, or (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 # 02110-1301, USA.
22 # query_media.pl
24 use warnings;
25 use strict;
27 use Carp qw(croak);
28 use WWW::Quvi;
30 use constant URL =>
31 "http://www.dailymotion.com/video/xdpig1_city-of-scars_shortfilms";
33 my $q = new WWW::Quvi::Query;
35 # Query media.
37 my $m = $q->parse(URL);
38 croak "error: $q->{errmsg}\n" unless $q->{ok};
40 printf "%10s : %s : %s
41 %10s : %s : %d bytes
44 $m->{page_title},
45 $m->{id},
46 $m->{host},
47 $m->{content_type},
48 $m->{file_suffix},
49 $m->{content_length},
50 $m->{url};
52 # vim: set ts=2 sw=2 tw=72 expandtab: