I made a Twitter feed called @PDML. The letters stand for Pentax-Discuss Mailing List, which I read with pleasure; a high-volume, rowdy, enjoyable gaggle of camera geeks. One of the things they do is post nice pictures, which are identified with a subject line starting “PESO:” for Picture Every So Often (and sometimes “GESO:”, G for Gallery). @PDML has those posts’ first hyperlink and as much of their content as can be stuffed into 140 bytes. It’s a nice low-volume Twitter feed, less than five pix a day on average. I believe this is what the cool kids call a “Mashup”. A very slow one, but still.
[Update, 2009/03/08]: @PDML was broken but is back. It turns out that in Google’s opinion I was violating their terms of service; the Gmail account was disabled. I shifted it over to a POP account on one of my own domains, like I should have when I set it up.
Is This OK? · I didn’t ask the PDMLers, nor the Twitterers, nor the other silent players (see below). But I don’t expect any static; when you publish a pointer on the Web, I think it’s OK to repurpose it. A lot of the pictures themselves have some rights reserved, and are clearly marked as such, which is just fine.
This is one of the Good Things about the Web.
How It Works · First, I created a new Gmail account, subscribed it to PDML, and POP-enabled it.
Then I wrote a little Ruby program to read the mail. It turns out that the current Ruby 1.8.6 doesn’t support POP+SSL, so I had to use Ruby 1.9. The API is pretty simple.
The Ruby program figures out which posts are PESOs, distills out a message, and POSTs that via the Twitter REST API.
The hardest part was distilling the email content down to a useful 140-byte chunk. You have to get the hyperlink and title in, plus the author’s name if at all possible, and lots of times that still leaves room to fish around in the email body for more. Once I’d written some fuzzy unit tests, I lost my fear and just sorted that out.
I saved some space by calling out to is.gd for URI shortening.
So the Ruby program, now bloated up to a big 103 lines, is running as a
cron job a few times an hour over on
That’s Nice · You don’t say. I had the idea mid-morning on Tuesday, and the basic structure working by late afternoon. And that’s leaving time for one teleconference, a visit to my lawyer’s office, and lunch. It took me till sometime Wednesday to get the rough edges filed down and things looking good. Live testing was very slow, because there are only a couple of PESOs a day and I couldn’t figure out how to read the post via POP without marking it as read, so I could use each only once.
I held off a couple of days announcing it so as to build up a few PESOs in the feed. There also remain a few tweets which are debugging grunge and which Twitter failed to delete no matter how politely I asked.
Any Problems? · Well, it does bother me that I’m not paying for any of this. I’m using Gmail as a handy POP service and never looking at an ad, which pretty well nukes their business model. This is particularly egregious since I have a few domains where I could set up a mailbox and POP server but that would be, you know, work, and Gmail is just, you know, there. I’m using the is.gd service similarly. It doesn’t cost anything to read PDML or post to Twitter.
Is this a problem?