Minor Midgard Blogging Tool Updates

Categorizing Midgard posts in MarsEdit

Categorization works quite simply; the MetaWebLog API connector for the de.linkm.newsticker looks at its schema definition, and if it finds specific field definitions it will enable categorization. The two options here are:

Multiple categories per post:

"categories" => array (
"description" => "Categories",
"datatype" => "multiselect",
"location" => "parameter",
"multiselect_selection_list" => array (
"cat1" => "Category 1",
"cat2" => "Category 2",
),
),

Or single category per post (as is currently used on this blog):

"category" => array (
"description" => "Category",
"datatype" => "text",
"location" => "parameter",
"widget" => "select",
"widget_select_choices" => array (
"cat1" => "Category 1",
"cat2" => "Category 2",
),
),

Note: the category field must be stored in parameter location for MetaWebLog API support to work.

Now that this works well, I was able to set my MarsEdit to complain if I try to save an entry without setting a category. Categorization is important on this blog as it is used by the different Planet aggregators.

This means that now I can almost completely manage this blog from a desktop client. Only thing remaining would be handling the separate abstract fields, but I might as well make my next layout do without them.

Bloglines setting in net.nemein.rss

The other new thing is that the net.nemein.rss news aggregator for Midgard CMS now has preliminary support for the Bloglines API. Bloglines is a popular web-based news aggregator that can be used as a central syndication server to reduce RSS-induced congestion.

It is easy to set net.nemein.rss to fetch it news from Bloglines instead of querying the servers independently:

  • Register to Bloglines and subscribe to the feeds you want to aggregate
    Note: you can populate the Bloglines subscription list by uploading the OPML list of subscriptions you get by accessing /channels.opml in net.nemein.rss
  • Create a topic handled by net.nemein.rss
  • Go to Settings and select Bloglines from Subscription mode
  • Enter your Bloglines username and password to net.nemein.rss

The infrastructure for this seems to work. Unfortunately I was unable to test this with a real production setup because Bloglines Web Services seem to respond extremely slowly today, causing MagpieRSS to timeout.

Updated 22:33: After adding some debugging calls I found out that the reason for problems with getting feeds from Bloglines was with HTTP Basic authentication. Bloglines uses email addresses as usernames.

While fopen happily opened such an URL after the email address was rawurlencoded, the Snoopy library in MagpieRSS was a different case. As I found out, it uses PHP's parse_url function which doesn't support @-signs in usernames.

I fixed this by a quick hack to the Snoopy fetch method:

$URI_PARTS = parse_url($URI);
if (!empty($URI_PARTS["user"])) {

  // PATCH for Bloglines support, @ in usernames (bergie)
  if (strstr($URI_PARTS["user"],"%40")) {
    $URI_PARTS["user"] = str_replace("%40","@",$URI_PARTS["user"]);
  }
  // END PATCH

  $this->user = $URI_PARTS["user"];
if (!empty($URI_PARTS["pass"]))
  $this->pass = $URI_PARTS["pass"];

To make things easier I upgraded net.nemein.rss to include latest MagpieRSS. This means that Atom feeds should be supported now as well.

Even though the Bloglines API support works now, it still seems to be phenomenally slow, at least with my 100 subscriptions.


Read more Midgard posts.