2006-09-11 Looking at Flock

Have you tried Flock? I’m giving it a try at the moment. It says that it can integrate blogging using “Wordpress, Movable Type, Typepad, LiveJournal, Typo, and Drupal and integrates with the Blogger, Meta Weblog, Typepad, and Atom APIs.”

=> Flock

Maybe I should write a complete Atom API for Oddmuse. Right now the Oddmuse:Atom Extension is a proof-of-concept extension that’s not really as flexible as the existing Oddmuse:Rss Action.

=> Oddmuse:Atom Extension | Oddmuse:Rss Action

At least exporting my subscriptions from BlogLines as an OPML feed, and subscribing to all of them in flock went smoothly. Yay for open standards! ❤ ❤ ❤

=> BlogLines

Actually the Bloglines searches did not work out of the box, because I hadn’t subscribed to them as RSS feed. Redoing the searches allowed me to subscribe to the RSS feeds, so that went well. Since I’m reading news from multiple machines, however, moving away from Bloglines is not an option. I was just “checking”... ;) I see that Flock is planning to look into the issue, however. ¹ I think they should just interface with Bloglines!!

=> ¹

Logging into LiveJournal as a test automatically notified Flock that I signed into a site that it supported for blogging, and offered to do all the configuration automatically. It felt eerie, but it worked. Except that I don’t want to blog on LJ. — Or do I?

Anyway, I started working on Atom.

I downloaded XML::Atom, but it seemed complex. So I started to read the draft ² and started implementing: Return a simple “introspection document”.

=> XML::Atom | ²

Alpinobombus:~ alex$ curl http://localhost/cgi-bin/wiki/atom




entry, image/jpeg, image/png


I’m using the correct MIME type (application/atomserv+xml), and yet Flock keeps complaining that something’s wrong about it.

I guess I didn’t neet to go very far to realize I wouldn’t get far. 🙁

The meat of my Oddmuse extension:

push(@MyInitVariables, \&AtomInit);

sub AtomInit {
  SetParam('action', 'atom') if $q->path_info =~ m|/atom\b|;
}

$Action{atom} = \&DoAtom;

sub DoAtom {
  my $id = shift;
  DoAtomIntrospection();
}

1. from http://www.ietf.org/internet-drafts/draft-ietf-atompub-protocol-09.txt
sub DoAtomIntrospection {
  print GetHttpHeader('application/atomserv+xml');
  my @types = ('entry', );
  push(@types, @UploadTypes) if $UploadAllowed;
  my $upload = '' . join(', ', @types) . '';
  print <



$upload



EOT
}

Too bad Flock didn’t like it!

I’ve also installed RPC::XML, considering the implementation of the MetaWeblog API. But that, too, looks complicated. I really, really like simple code. 😄

=> MetaWeblog API

So now I wrote a simple skeleton for the MetaWeblog API:

use RPC::XML::Server;
require RPC::XML::Procedure;

$srv = RPC::XML::Server->new(port => 9000);

my $new = RPC::XML::Procedure->new({ name => 'metaWeblog.newPost',
				     code => sub { OddmuseNew(@_) },
				     signature => [ 'string', 'string',
						    'string', 'struct',
						    'boolean' ] });
my $edit = RPC::XML::Procedure->new({ name => 'metaWeblog.editPost',
				     code => sub { OddmuseEdit(@_) },
				     signature => [ 'string', 'string',
						    'string', 'struct',
						    'boolean' ] });
my $get = RPC::XML::Procedure->new({ name => 'metaWeblog.getPost',
				     code => sub { OddmuseGet(@_) },
				     signature => [ 'string', 'string',
						    'string' ] });

$srv->add_method($new);
$srv->add_method($edit);
$srv->add_method($get);

$srv->server_loop; # Never returns

1. metaWeblog.newPost (blogid, username, password, struct, publish)
1. returns string

sub OddmusePost {
  my ($blogid, $username, $password, $struct, $publish) = @_;
  return "foo";
}

1. metaWeblog.editPost (postid, username, password, struct, publish)
1. returns true

sub OddmuseEdit {
  my ($postid, $username, $password, $struct, $publish) = @_;
  return 1;
}

1. metaWeblog.getPost (postid, username, password) returns struct

sub OddmuseGet {
  my ($postid, $username, $password) = @_;
}

As you can see, no real code there.

I then created a file containing my request:



  metaWeblog.newPost
  
    
      Wiki
      AlexSchroeder
      Hibiskus$$Fresser
      
	Testing Meta
	This is my text!
      
      1
    
  

And ran the server and tested it using curl:

=> curl

Alpinobombus:~ alex$ curl --data @~/oddmuse/meta-new.xml localhost:9000
403 Forbidden

403 Forbidden

Didn’t get very far here, either!

Perhaps I should use Net::Blogger instead of Flock to test my implementation. ;)

=> Net::Blogger

Later, I returned to Atom! See 2006-09-16 Atom Revisited.

=> 2006-09-16 Atom Revisited

​#Software ​#Web ​#Flock ​#Atom ​#Oddmuse

Proxy Information
Original URL
gemini://alexschroeder.ch/2006-09-11_Looking_at_Flock
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
164.057259 milliseconds
Gemini-to-HTML Time
1.9756 milliseconds

This content has been proxied by September (3851b).