root/lang/perl/WWW-YourFileHost/trunk/t/01.t @ 38771

Revision 38771, 0.7 kB (checked in by yusukebe, 2 years ago)

fixed for new api.

Line 
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5use LWP::UserAgent;
6use HTTP::Cookies;
7use WWW::YourFileHost;
8use Test::More tests => 3;
9
10my $url = "http://www.yourfilehost.com/media.php?cat=video&file=kitty_birthday_card.flv";
11my $ua = LWP::UserAgent->new( agent => "Mozilla/5.0 (Windows; U; Windows NT 5.0; ja; rv:1.9) Gecko/2008052906 Firefox/3.0", show_progress => 1, cookie_jar => {} );
12
13my $res = WWW::YourFileHost->new( url => $url, ua => $ua );
14isa_ok $res, 'WWW::YourFileHost';
15
16my $checksum = '9c557d375a926e1a6002177c7da34dd4';
17like $res->photo,    qr/$checksum\.jpg$/, 'photo';
18like $res->video_id, qr/$checksum\.flv/,  'video_id';
19diag($url);
20diag($res->video_id);
21diag($res->swf);
Note: See TracBrowser for help on using the browser.