Skip to content

Instantly share code, notes, and snippets.

@yusukebe
Created February 26, 2009 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yusukebe/70822 to your computer and use it in GitHub Desktop.
Save yusukebe/70822 to your computer and use it in GitHub Desktop.
#!/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