ic: website ic:blog
  ic: website Home · Archives · Photo Gallery · ic: forum RSS logo - thanks to www.nineteenlabs.comWeb feed (RSS)  
The life and times of james Hart: his family, his music, life in Luton and his occasional escapes onto the internet.

« moblog : 28-09-2007 at 15:55 | Main | moblog : 29-09-2007 at 19:32 »

Saturday, 29 September 2007

How to moblog with Movable Type on a Mac ... maybe! (Techie)

Well, I think I've finally done it. It's possible - in the UK - to write a blog entry via text message (or MMS for entries with pictures)! if you're using Apple Mail and the free Movable Type blogging tool. Here's how...

  • Send an email containing the blog entry (as an MMS) to an unused POP3 account with the blog entry. You'll need this so you can create an Apple Mail rule to process emails only to that account (it's the easiest way to do it. You can, I guess, modify the rule so it's looking for something like "moblog:" in the message body, though).

  • If you just to use an SMS, I can heartily recommend aql.com - you can text +44 7766 404142 with an email address followed a message, and it'll send it on for the price of a standard text.

  • Next, a bit of Applescript needs to be written to extract the message from the email, and save attachments. Here's my script that does that, based on one I found by Luke Jaeger. The most important bits are:
    set OutputFolder to "Macintosh HD:Users:james:moblog:cache:"
    set this_file to "Macintosh HD:Users:james:moblog:cache:message.txt"
    since these are the locations the shell script will be looking in to sort out the blog entry and pictures, and
    do shell script "/Users/james/moblog/moblog.sh"
    which is the location of the shell script that sorts out the blog publishing. text version here

  • So next, it's shell script time. I created a directory called moblog in /Users/james, and a subdirectory within it called cache in which to put the working files. Then I created a shell script, which also needs to tidy up the text, since it seems to be in UTF format (arrgh!), so it needs an awk script to help with that.
  • Finally, you'll need to put a copy of mtsend.py, a very useful bit of python script by Scott Yang, in the moblog directory, since it's referred to by the shell script. So that everything's nice and tidy, I put the mtsendrc configuration file in the moblog directory as the rest of the scripts.

  • Finally, you'll need to make a message rule in Apple Mail to run the SaveMailAttachmentsToMoblogCache script... and with any luck, it'll work.

There's no doubt that this is a horrendously convoluted way of posting Movable Type; I guess I could use something like Fetchmail to avoid having to use the terrifying Applescript (never again if I can help it! It makes very little sense, and any bit of mis-coding it encounters will doubtless crash the application you're trying to run it on...)

Posted by james at September 29, 2007 10:20 AM

This site is owned and operated by Image Communications, including all content and stuff.
It's powered by Movable Type 5.2