Posting Bookmarks to Delicious From My Android G1
For a while I’ve wanted the ability to bookmark pages in delicious from my Android G1. After a few weeks of occasionally looking to see if anyone had done the work for me I started to investigate building an Android app. I got about as far as reading through some of the tutorials but never seemed to find the time to really get stuck in. In the meantime, to get around the limitations of the client side only bookmarks on the G1, I would save a draft email containing the URL of the page I was interested in and later open it on a desktop machine and post to delicious. Saving a draft is fairly trivial in that you visit a page in the browser, hit the share menu item, choose gmail and hit save draft (sharing via gmail pastes the URL of the current page into the body of the email) but the whole process was a bit cumbersome. I think it was about a week ago when I realised that I should just be able to email my bookmarks to delicious directly. A little searching appeared to suggest that there was nothing to let me do this1 so I went about hooking a few things together in order to get the functionality I was after.
I have recently discovered just how simple and powerful rack is, especially when combined with Phusion Passenger (which makes it stupidly easy to deploy rack apps). It seemed ideal for the job. Combine that with smtp2web (I recently rediscovered this after catching up on all the webhook buzz that seems to be doing the rounds) and a little bit of ruby to talk to delicious and I had everything I needed. So, I spent an hour or so last night getting a little end to end proof of concept up and running. Happy that I could hook all the components together I spent a further two or three hours tidying everything up and getting an app together (source in google code) that I could deploy to my exonetric VPS. I was even able to use the service for real on the train this morning.
Feel free to deploy the code to your own server (or the awesome heroku) if you wish to post bookmarks to your own account. You’ll need to copy config/delicious.yml.example to config/delicious.yml and enter your delicious credentials. The email parser expects to get the bookmark title in the subject line of the email (required), the URL on the first line of the email body (required) and tags on a line in the body beginning with T (i.e. /^T (.*)/). The rest of the body is treated as the notes. I was originally going to see if there was any interest in a hosted service whereby you register your delicious credentials and receive a secret email address to use in order to post to delicious. It seems that ping.fm already has this covered so I’m not going to worry about hosting it for anyone but me.
I love how relatively easy it is to hook these things together, in a short period of time, to produce something useful.
Note. I searched again for android delicious clients just before I started writing this post and was slightly surprised to see that there are now two apps that offer this functionality: Android delicious bookmarks and Beelicious (for which I couldn’t find a link).