MT Activity Streams

I’m experimenting a bit with Movable Type 4.1 and the Action Streams plugin.

Check out the work in progress at johneckman.com. Read on if you’re interested in creating your own action streams.

Although it has been a while since I’ve worked in Movable Type, it was a relatively painless install (assuming you’ve got the basic LAMP stuff in place).

The challenge was creating additional “services” for this blog and goatless. There’s some basic info on writing new services in this blog post: “building action streams” – but it took some time to translate this into my way of thinking about it, including where the png file goes for the icon for the service.

Here’s what the config.yaml looks like for the OpenParenthesis service:

name: Open Parenthesis
id: openparenthesis
key: openparenthesis
author_link: http://johneckman.com/
author_name: John Eckman
description: Adds profile service and activity stream for Open Parenthesis
version: 1.0
plugin_link: http://johneckman.com/

profile_services:
    openparenthesis:
        name: Open Parenthesis
        url: http://www.openparenthesis.org/
        icon: images/openparenthesis.png

action_streams:
    openparenthesis:
        posted:
            name: Posts
            description: New Posts to the Blog
            html_form: '[_1] blogged on <a
                href="http://www.openparenthesis.org/">OpenParenthesis</a> 
                about <a href="[_2]">[_3]</a>'
            html_params:
                - url
                - title
            url: 'http://feeds.feedburner.com/OpenParenthesis/'
            identifier: url
            xpath:
                foreach: //item
                get:
                    created_on: pubDate/child::text()
                    url: link/child::text()
                    title: title/child::text()

This config.yaml file goes in mt/plugins/openparenthesis/config.yaml – that is, you create a new plugin folder containing just this config.yaml.

Then you put the openparenthesis.png in: mt/mt-static/plugins/openparenthesis/images/openparenthesis.png

I suppose much of this would have been obvious had I been more accustomed to how MT plugins work.

You may also note I’m just hardcoding a pointer to my feedburner feed – so technically there is no “{{ident}}” needed – it doesn’t matter what identifer I put in.

One could translate this by changing:
url: 'http://feeds.feedburner.com/OpenParenthesis/'
to:
url: 'http://feeds.feedburner.com/{{ident}}/'

And then entering the feed name (the only part of a feedburner feed which changes) into the identifier field when adding the service to your profile from the MT admin side. That would give you a generic FeedBurner feed, to add blog postings to your action stream.

Of course, this may not make sense if your blog is itself on Movable Type, since your blog postings will be directly in your feed, but if you’re creating your action stream on separate domain, it may come in handy.

You can create extra “profile” links which offer no streams as well. For now I’ve just cheated with the link to Optaros at the top of my “Find Me Elsewhere” list.