Abusing TrackBack for fun: Mobile blogging

Normally, I think of mobile blogging as a bit silly, mostly because what I have to say usually can wait until I’m home and in front of a computer. However, I do realize that other people might have other needs. So when I discovered that fellow Norwegian blogger Eirik Newth had written a short how-to on blogging with Movable Type from a PDA, I decided to abuse trackbacks for the purpose of blogging from any WAP/WML 1.1-enabled device.

I’ll take you through this, step by step.

Before we start: I assume you’re so familiar with the Movable Type interface that you won’t need any screenshots, and I also assume you’re familiar with the templates of Movable Type.

Blogging on nine keys is typically more of an immediate experience, with shorter entries – which makes the trackback system well suited to this. We’re limited to entries of max 255 characters, which should be fine.

The first thing you have to do is to create a category for your mobile blog entries, and enable Category TrackBack pings. If you wish to, you can also set a passphrase. At the bottom of the category attributes screen, you should have a TrackBack URL much like this.

http://www.example.com/cgi-bin/mt-tb.cgi/337/yourpassphrase here

Remember this URL as you will need it later.

Next, download this WML file (if your browser tries to display it, you’ll have to do a right-click and “Save as …”). Open this file in a text editor.

In this document, you’ll find a string that reads {Your TrackBack URL}. Replace this string with the trackback URL we created a bit earlier. Likewise, replace the string that reads {Your Blog URL} with the actual URL of your blog. Save the document and upload it to your server so it’s accessible from the web.

Since the passphrase to the category TrackBack is readable from the document source, it would be wise not to let this file show up in directory listings or anywhere else public.

The only thing left before you’re ready to post from your mobile phone, is to create code to show your blog entries, either into an existing index template, or by creating a dedicated index template for your entries. If we assume you named the category you want to put your mobile entries into “Mobile blog”, this is what the corresponding code could look like:

<MTPings category="Mobile blog" lastn="30">
<h3><$MTPingTitle encode_html="1"$></h3>
<p>[<$MTPingDate format="%Y-%m-%d %H:%M"$>] <$MTPingExcerpt encode_html="1"$></p>
</MTPings>

That’s really it and by now, you should be ready to blog from your mobile phone. This would be where the WML document you created earlier resides. If you have done everything right, your mobile phone should present you with a form where you can enter the title and content of your entry, and a link to post the entry itself.

When you have finished your entry, and have chosen to post it, a brief period of time will pass, and your phone will most likely return with an error message, saying there was a fault with the resource you tried to access. Do not worry, this is perfectly normal. The error occurs because the Movable Type TrackBack script returns an XML document not understood by your phone, the data are still posted to your blog.

During testing, you might want to test this on a computer instead of on the phone, to see if any error messages are returned. Besides being a perfectly normal web browser, Opera also understands, renders and interacts with WAP/WML pages, so you could test there (And yes, I strongly recommend you do test).

When you test in Opera and submit the form with your blog entry, Opera will display a “0” in the browser window if everything went well, and a “1”, plus a verbose text message if anything failed.

This is really all there is to it. Crude, but effective. If you want to extend on this, the possibilites are near infinite; By writing some simple wrapper code on the server, Movable Type could act as a WAP-based SMS/IM system. Who really needs ICQ, AIM or MSN Messenger Service on their phone when all they need is Movable Type?

Previous Post

4 Comments

  1. WapBlog

    Auðvitað er hægt að senda inn í MT svona! Ég sem hélt að ég þyrfti að skrifa einhvern foxleiðinlegan kóða til sem tæki við tölvupósti og notaði sem entry. Jibbí!…

  2. Now this is cool, if it works

    I came across a post about mobile blogging, and an easy way to set it up. I’ve tried some of the phone apps, but they don’t seem to work with my phone, so I’m going to have to give this…

  3. wap en i-mode site maken met movable type

    Toevoegen aan wachtrij voor volgend projectje: deze site geschikt maken voor WAP en i-mode. Nu nog een reden bedenken om mijn site mobiel te willen raadplegen. Wél heel erg leuk: de mogelijkheid inbouwen om berichten te posten via MT (mobloggen)…

  4. Resources Tested

    Able to get a hack/script working: From a forum somewhere, “http://www.virtuelvis.com/archives/71.html”. Currently using it. Pros: It is working. Simple to use. Cons: Hard to deploy and configure. Limited functionality: Excerpts and Title (url?). Lack …