Monthly Archives: April 2009

SAP everywhere!

I remember back in the ’90s joking with my friend Piers

When I see the first book on SAP hit the bookstores, it’s time to move on :-)

In those days there were no books on SAP, and I was still in shock from receiving SAP documentation properly printed and bound — in the early days we had SAP install guides on green and white striped fanfold paper from daisywheel printers, with sentences literally half in German, half in English.

How things have changed. Beyond the SAP Developer Network, which I can proudly say I had a hand in forming and nurturing, I’ve just seen a video on YouTube by Jon Reed on how to find and follow SAP people on Twitter! I’ve also just added myself to the SAP Affinity Group. A long way from SAP-R3-L!

Perhaps it’s time to rebuild Planet SAP?

An HTTP connector for Tarpipe: ‘tarbridge’

One thing that Tarpipe would really benefit from is a connector that would enable an HTTP request (I’m thinking of POST, here) to be made on an arbitrary resource (URL). This is something that other people have already mentioned — and the Tarpipe folks are certainly working on it.

I couldn’t wait, however, and thought I’d have a bit of fun building an HTTP connector. I don’t have access to Tarpipe’s sources, so I had to go a roundabout route. Tarpipe has a Mailer connector, which enables emails to be sent from within a workflow. So I built a very simple email-to-HTTP-POST mechanism ‘tarbridge’. This way, you can use the Mailer connector to send an email like this:

Recipient: tarbridge+<token>@pipetree.com
Subject: the URL to POST to and an optional content-type
Body: the payload of the HTTP POST

and an HTTP POST will be made to the URL specified. You’ll even get an email reply with the HTTP response.

Here’s an example workflow that receives an email containing something to bookmark in Delicious. It uses the Delicious connector, and also makes an HTTP POST to a little test application (running on a local devserver version of the excellent Google AppEngine, fwiw) via tarbridge.

Workflow using tarbridge

The Subject of the email contains the URL to make the HTTP POST to. By default the Content-Type will be set to application/x-www-form-urlencoded, but you can override this by specifying a different content type (here I’ve specified text/plain) as a second parameter in the Subject.

The addressee of the email is ‘tarbridge+<some token>@pipetree.com’. I’ve used this approach so I can control what goes through this tarbridge mechanism. A token is associated with an email address, to which the HTTP response is sent in reply.

The body of the email is what’s send as the payload in the HTTP request.

So sending this email to the Tarpipe workflow above:

From: DJ Adams <dj@pipetree.com>
To: bury69xxxx@tarpipe.net
Subject: http://blog.tarpipe.com

Tarpipe blog

results in this Delicious entry:

Tarpipe Blog URL on Delicious

and this email sent, via the Mailer connector, to the tarbridge mechanism:

To: tarbridge+token@pipetree.com
Subject: http://www.pipetree.com:8888/feed/ text/plain
From: tarpipe mailer <mailer@tarpipe.net>

http://blog.tarpipe.com http://del.icio.us/url/95948a42d8777b46278d4da333345473

which in turn results in an HTTP POST being made like this:

POST /feed/ HTTP/1.1
User-Agent: tarbridge/0.1 libwww-perl/5.812
Host: www.pipetree.com:8888
Content-Type: text/plain
[...]
http://blog.tarpipe.com http://del.icio.us/url/95948a42d8777b46278d4da333345473

The result of the HTTP POST is emailed back like this:

Subject: Re: http://www.pipetree.com:8888/feed/ text/plain
To: DJ Adams <dj.adams@pobox.com>
From: tarbridge+token@pipetree.com
HTTP/1.0 201 Created
Date: Fri, 24 Apr 2009 10:06:55 GMT
Location: http://www.pipetree.com:8888/feed/test-feed-1/agtmZWVkYnVpbGRlc[...]
[...]

So if you were really crazy you could even feed that response back into the Tarpipe loop, using a second workflow (hmm, Tarpipe could do with a string parsing connector too :-)

The tarbridge mechanism is just a little Perl script that’s triggered via Procmail. I’m running Ubuntu on pipetree.com so it was just a question of configuring Postfix to use Procmail for delivery, and writing a .procmailrc rule like this:

:0 c
| ~/handler.pl 2>> ~/tarbridge.log

If you’re interested in trying this out using my (pipetree) instance of this tarbridge, please email me and I’ll set you up with a token. Usual caveats apply. And remember, this is only in lieu of a real HTTP connector which I hope is coming soon from Tarpipe!

tarpipe.com – Programming 2.0?

Is tarpipe.com an early example of a “Programming 2.0″ concept?

I first read about Tarpipe from Curt Cagle’s “Analysis 2009″. In turn, Curt points to Jeff Barr’s post which describes the concept and the implementation very well. It’s a fascinating concoction of Web 2.0 services and visual programming (in the style of Yahoo! Pipes), and in its beta infancy has that great “wow, imagine the full potential!” feel to it.

Here’s an example of what I’ve been playing around with. With my phone — and with the G1 it’s so easy — I can snap a picture of the beer I’m drinking, and email that picture to a Tarpipe workflow, along with the name of the beer in the subject line and a list of tags rating the beer in the body.

The workflow uses the existing Tarpipe connectors to:

  • post the picture on Flickr with the beer name as the title and the rating words as tags, including a statically added ‘beerrating
  • have a short URL constructed via TinyURL for the new Flickr picture page (ok this is pre Kellan’s rev=”canonical”, and while Flickr already has such links the URLs are not exposed by Tarpipe’s Flickr connector)
  • dent the rating, with the short picture URL, on identi.ca (which in turn, re-dents to Twitter too)
  • reply to the original email confirming that the beer was successfully rated

All in the space of a few clicks and drags! Here’s a shot of that workflow (with a couple of connectors partially obscured — it’s a known bug in Tarpipe):

tarpipebeerrater

Tarpipe workflow for beer rating

But what’s more fabulous: Tarpipe has been ideal for my son Joseph to start up with programming, with me. And he finds it really interesting. Visual, direct feedback, using and connecting things and services he understands. Gone are the days of

10 PRINT "HELLO WORLD"
20 GOTO 10

on black and white low-res displays.

After explaining a few concepts, Joseph was totally up and away, building his first workflow which is pretty impressive! (I’m a biased, proud dad of course :-) And now we’re off looking at Yahoo! Pipes too, and he’s asking how we can link the two services together.

Hello, new programming world.

Old feed URLs fixed with a bit of mod_rewrite voodoo

As feeds are the new blogs (quoting myself, oh dear!) I thought it important to make sure that the feed bots that have been continuously polling my weblog’s feed and getting 404s (since 2005, I guess) are sent to the right place. My Apache access.log file was showing that 404s were being returned for /qmacro/blog/index.rdf and /qmacro/blog/index.xml, and /qmacro/xml for that matter … all old locations for the weblog feed.

The power of HTTP, and the voodoo of mod_rewrite, allow me to fix things. Inserting these lines into the relevant .htaccess files does the trick:

RewriteRule ^index.(xml|rdf)$ /qmacro/blog/feed/atom/ [R=301,L]
RewriteRule ^xml$ /qmacro/blog/feed/atom/ [R=301,L]

Now the bots are redirected to this weblog’s shiny new feed. And I’ll try not to change the URL again :-)

Back from Real Life

I’m back online, after an eXtended Away in Real Life. I don’t think my online presence will ever be what it was (I can’t believe how much I posted in the past few years) but blogging isn’t the same anyway. Even the new UK edition of Wired magazine (I’ve subscribed, btw) lists blogging under “Tired”. Now there’s microblogging (identi.ca and Twitter spring to mind immediately) and people seem to be *emailing* each other on Facebook these days! That’s the equivalent of the heinous corporate crime of using Excel for everything, like sending screenshots to each other, or writing simple lists (*shudder*).

What’s more, my son Joseph is online now too, complete with blog, identi.ca & Twitter accounts, and more!

Anyway, I’ve got myself a local copy of WordPress, and am slowly retrieving my past with the help of The Wayback Machine. It’s a slow and not entirely painless process, but I’m getting there. I’m doing a month at a time, and am up to Jan 2003. Nothing’s properly categorised or tagged yet, nor are all the links working perfectly. There are even some posts that aren’t properly datestamped yet! More importantly, I haven’t yet put the mod_rewrite magic in place to reduce the 404s that I’m seeing in my HTTP access log.

Watch this space.