Skip to content

Instantly share code, notes, and snippets.

@kga
Created June 15, 2009 16:27
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 kga/130200 to your computer and use it in GitHub Desktop.
Save kga/130200 to your computer and use it in GitHub Desktop.
#!/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