Permalink
Browse files

fixed to fetch blog.naver.com

  • Loading branch information...
JEEN committed Sep 16, 2010
1 parent 1ec2297 commit d33443a7c6baa881b4d542b23087de5468ce8593
Showing with 2 additions and 3 deletions.
  1. +2 −3 plugins/blog.naver.com/fetch
@@ -1,6 +1,6 @@
use LWP::UserAgent;
use Encode ();
use Data::Dumper;
sub fetch {
my ($self, $url) = @_;
@@ -9,14 +9,13 @@ sub fetch {
my $c = $r->content;
# /PostView.nhn?blogId=sotkfkdthwls&logNo=10083366750&beginTime=0&jumpingVid=&from=search&redirect=Log&widgetTypeCall=true
my ($author, $article);
if ($c =~ /src="http:.+?blogId=([^&]+).*?\&logNo=(\d+)/m) {
if ($c =~ /src=".+?blogId=([a-z0-9_]+).*?\&logNo=(\d+)/m) {
$author = $1;
$article = $2;
} elsif ($c =~ /%2F([^%]+)%2F([^&]+)/) {
$author = $1;
$article = $2;
}
my $u = sprintf 'http://blog.naver.com/PostView.nhn?blogId=%s&logNo=%s', $author, $article;
my $r2 = $ua->get($u);
my $content = $r2->decoded_content;

0 comments on commit d33443a

Please sign in to comment.