AtomPubではてなに投稿

30分プログラム、その364。AtomPubを使って、はてなダイアリーに投稿してみた。
本当は、はてダラをAtomPubに対応させたかったんだけど、AtomPubは日付単位でなく、記事単位で投稿とかをするので、ちょっと難しいかもしれない。
ソースコード
#! /usr/bin/perl # -*- mode:perl; coding:utf-8 -*- # # hatena-diary.pl - # # Copyright(C) 2008 by mzp # Author: MIZUNO Hiroki / mzpppp at gmail dot com # http://howdyworld.org # # Timestamp: 2008/09/13 23:59:43 # # This program is free software; you can redistribute it and/or # modify it under MIT Lincence. # use strict; use warnings; use Atompub::Client; my $user = '<username>'; my $password = '<password>'; # 準備 my $client = Atompub::Client->new; # パスワードの設定 $client->username($user); $client->password($password); # エントリの作成 my $entry = XML::Atom::Entry->new; $entry->title('Test entry'); $entry->content('Hello'); # 投稿 $client->createEntry("http://d.hatena.ne.jp/${user}/atom/blog",$entry);