Created
February 26, 2009 12:48
-
-
Save yusukebe/70822 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use CGI; | |
use LWP::UserAgent; | |
my $q = CGI->new; | |
print $q->header( -type=> 'text/html', -charset=> 'utf-8'); | |
my $id = "sm6120845"; | |
my $js_url = "http://ext.nicovideo.jp/thumb_watch/$id"; | |
my $request = HTTP::Request->new( GET => $js_url ); | |
$request->header('Referer', "http://www.nicovideo.jp/"); | |
my $ua = LWP::UserAgent->new(); | |
my $response = $ua->request($request); | |
$response->is_success or die "Request failed: " . $response->status_line; | |
my $content = $response->content; | |
print '<script type="text/javascript">'; | |
print $content; | |
print '</script>'; | |
__END__ | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment