This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Feb 26th, 2012  |  syntax: None  |  size: 0.55 KB  |  views: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. #!perl
  2. use warnings;
  3. use strict;
  4.  
  5. use LWP::UserAgent;
  6.  
  7. my $title = 'エントリタイトル';
  8. my $excerpt = 'エントリ要約ですよ';
  9. my $url = 'http://d.hatena.ne.jp/shibaTest/20101022/p1';
  10. my $blog_name = 'Dive into the Tech World!';
  11.  
  12. my $ua = LWP::UserAgent->new;
  13.    $ua->timeout(10);
  14.  
  15. my $response = $ua->post(
  16.     'http://local.hatena.ne.jp:3000/shiba_yu36/20101022/1287724375', {
  17.         title     => $title,
  18.         excerpt   => $excerpt,
  19.         url       => $url,
  20.         blog_name => $blog_name,
  21.     },
  22. );
  23.  
  24. use YAML;
  25. warn YAML::Dump($response);
clone this paste RAW Paste Data