Mark asks for a Perl hacker [who] could mock up a similar prototype to his Python implementation of publishing via straight XML. So, what's 20 minutes of Perl hacking...

use XML::Smart;
use LWP::UserAgent;

my $entry = XML::Smart->new();
$entry->{entry} = {};
$entry->{entry}{title}[1] = 'My First Entry';
$entry->{entry}{subtitle}[1] = 'In which a newbie learns to blog...';
$entry->{entry}{summary}[1] = 'Very boring entry...';
$entry->{entry}{author}[1]{name}[1] = 'Bob B. Bobbington';
$entry->{entry}{author}[1]{homepage}[1] = 'http://bob.name/';
$entry->{entry}{author}[1]{weblog}[1] = 'http://bob.info/';
$entry->{entry}{issued}[1] = '2003-07-07T23:50:00';
$entry->{entry}{content} = 
  {'xml:lang' => 'en', type => 'application/xhtml+xml', 
  content => '<div xmlns="http://www.w3.org/1999/xhtml">
This is my full content entry. It <em>contains</em> inline XHTML markup.</div>'}; print "Sending...\n"; print $entry->data, "\n"; my $ua = LWP::UserAgent->new(env_proxy => 1, keep_alive => 1, timeout => 30, ); my $response = $ua->request(HTTP::Request->new('GET', 'http://example.org/reilly', HTTP::Headers->new(Content_Type => "application/not-echo+xml"), $entry->data));

J$


$a="A"and$'_="J";map{$a++}(66..ord
);$$_='$';print$'a,$$a

Trackbacks

Comments