16 March 2010

Bookmarklet: Add URL to Remember the Milk from the iPhone

I use Google Reader on all my mobile devices (currently an iPhone) and frequently find myself wanting to switch to the desktop to finish a story.  Google Reader has great desktop integration with other services to save articles, but is very limited on the iPhone.  Google Reader mobile allows you to email a link to yourself, but the whole process is painful and I get enough email.

I am also a heavy user of Remember the Milk as my task management system.  Wouldn't it be great to be able to add URL's directly from the iPhone?  Enter the RMilk iPhone Bookmarklet.

var a = [
'name=' + document.title,
'url=' + location.href,
location.href = "http://m.rememberthemilk.com/add?" + a.join("&");

The Bookmaklet above adds the URL into the mobile Remember the Milk site.  The following values are populated:

  • name: The name of the page you are viewing will be the task name.
  • url: The URL is the page you are viewing.
  • due: The due date can be any legal value that Remember the Milk can validate as a date.
  • priority: Legal priority values are 1, 2, 3, and 4 (none).
  • tags: Any tag (or tags) you would like to use to populate your task.
Additionally, there are two other options worth noting:
  • estimate: Any valid time estimate can be used 
  • list: The integer list id that applies to your list.  If you want the URL to go to a specific list, go to http://m.rememberthemilk.com/add.  View the page source and find the list of values that contains your list.  Use the value attribute from the option tag as your list value.
To add this bookmarklet to your iPhone, do the following:
  • Copy the JavaScript Bookmarklet above into Notepad.
  • Edit the values in the array as to how you would like to populate Remember The Milk.  Add estimate and list to the array if you would like those values populated.
  • Copy the new JavaScript into an email and email it to your iPhone.  Copy the JavaScript from the email.
  • Bookmark any page in Safari.  Edit the bookmark by giving it a new name and pasting the JavaScript into the URL textbox.

This post is heavily indebted to Steve Ollis, The IT Juggler.