Skip to content

Instantly share code, notes, and snippets.

@kga
Created Jun 15, 2009
Embed
What would you like to do?
#!/usr/bin/env perl
use strict;
use warnings;
use Perl6::Say;
use YAML;
use Config::Pit;
use LWP::UserAgent;
use HTTP::Request::Common;
use utf8;
my $conf = pit_get('hatenabookmark-webhook', require => {
url => 'webhook-url',
key => 'webhook-key',
});
my $ua = LWP::UserAgent->new;
my $res = $ua->request(POST $conf->{url}, [
status => 'star',
key => $conf->{key},
'username' => 'KGA',
'title' => 'こんにちはこんにちはエントリ',
'url' => 'http://www.google.com/',
'color' => 'blue',
'quote' => 'quote',
'timestamp' => '1994-11-05T08:15:30-05:00',
]);
say Dump $res->headers;
say $res->content;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment