|
Revision 38771, 0.7 kB
(checked in by yusukebe, 2 years ago)
|
|
fixed for new api.
|
| Line | |
|---|
| 1 | #!/usr/bin/perl |
|---|
| 2 | |
|---|
| 3 | use strict; |
|---|
| 4 | use warnings; |
|---|
| 5 | use LWP::UserAgent; |
|---|
| 6 | use HTTP::Cookies; |
|---|
| 7 | use WWW::YourFileHost; |
|---|
| 8 | use Test::More tests => 3; |
|---|
| 9 | |
|---|
| 10 | my $url = "http://www.yourfilehost.com/media.php?cat=video&file=kitty_birthday_card.flv"; |
|---|
| 11 | my $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 | |
|---|
| 13 | my $res = WWW::YourFileHost->new( url => $url, ua => $ua ); |
|---|
| 14 | isa_ok $res, 'WWW::YourFileHost'; |
|---|
| 15 | |
|---|
| 16 | my $checksum = '9c557d375a926e1a6002177c7da34dd4'; |
|---|
| 17 | like $res->photo, qr/$checksum\.jpg$/, 'photo'; |
|---|
| 18 | like $res->video_id, qr/$checksum\.flv/, 'video_id'; |
|---|
| 19 | diag($url); |
|---|
| 20 | diag($res->video_id); |
|---|
| 21 | diag($res->swf); |
|---|