Saturday 9 February 2013

Reimplementing the iDoneThis memory service

Photography by wadem, CC-BY-SA
There's an excellent website called iDoneThis.com, which implements the most simple yet brilliant of services. Every day, you record the list of things you've done, and it gives you a check-mark for that day. This was motivating in two ways: firstly, the desire to keep that chain of check-marks running (what's known as a 'chain calendar' or a 'Seinfeld calendar'), and secondly by emailing you your memories of what you were doing a year (or a week, or a month) ago.

For me, knowing what I was doing a year ago was really good. I loved waking up each morning to be reminding of something I might otherwise not think of again. The good memories I was emailed would make me feel good again, and bad memories? Well, they'd often make me feel good that I wasn't going through that anymore, or they'd be insightful if I was encountering similar issues now.

I loved the memory service, and so did my friends, even if they didn't use it. I'd often send them messages about what awesome adventures we were up to a year ago, and that would often make their day.

Unfortunately, a few months ago, iDoneThis discontinued their memory-posting service. I don't know why; I can only assume they're focusing on the more corporate part of their service, and the network costs of all the personal emails wasn't worth it.

Today, as part of a productivity spiral, I reimplemented the old memories service. The code isn't pretty—unfortunately iDoneThis doesn't (yet) provide an API—but I have a bot that can log-in and fetch a day's worth of data.  Best of all, that code is open source, and available from the CPAN, so you can download and use it yourself.


If you're not a Perl person, then it's pretty easy to install.  Simply follow my world's simplest guide to installing cpanm.

Now just install the WebService::Idonethis module:
cpanm WebService::Idonethis
To use it, you'll first need to create a ~/.idonethisrc file with your auth details:
[auth]
user=someuser
pass=somepass
If all has gone well, you can now use the idonethis-memories command!
$ idonethis-memories

Here's what you were doing on 2012-02-11:

* Built a robotic dinosaur with lasers with Claudine.
* Played stepmania with Deanna (Spice Girls rock!)
* Invoiced ALL the clients.
* Drank six billion cups of coffee.
It's perfect for putting into a cron job.

Edit: As of v0.03, you can now submit done items directly from the command line using the idone tool:
$ idone "Read a great blog by Paul Fenwick"
Edit: As of v0.04, you can also get a list of what you've done today:
$ idone -l

* Flossed my teeth
* Looked at pictures of cats on the Internet
* Defended against a goblin siege in Dwarf Fortress
If you're handy with Perl, or just want to look at the code, there's a github repository. Patches are extremely welcome!

Edit: As of v0.08, the idone -lc command is the best thing ever.  It will list the things you've done today, and allow you to add new things by entering them on stdin.  It also has less than a third of the previous dependencies.

Flattr this

7 comments:

  1. Ooh — do you know if this is a homebrew recipe yet? I'd love to use "idone" on the command line as I go along throughout the day. http://mxcl.github.com/homebrew/

    ReplyDelete
    Replies
    1. Thanks for the enthusiasm! I hadn't even heard of homebrew until today! As far as I know this isn't a recipe yet. I'm not a Mac user, but I'm definitely happy to assist in making this a recipe.

      At the moment the `idone` command is pretty much just a proof-of-concept. It works, but it has to login every time (and so is pretty slow). The next step would be to have it cache session cookies (which will speed things up considerably), and probably to add a few whistles and bells (like being able to read a list of items from a file, or have a command line switch for 'yesterday').

      It probably wouldn't hurt to slim down the dependencies either (although if you're a regular Perl user, you probably have most installed already).

      Delete
  2. I'll gladly help you test whenever you make it. For now I will install manually. This + instapaper + rumember will be my command-line trio :)

    ReplyDelete
    Replies
    1. Awesome! You'll notice that at the moment the `idone` program is *very* slow; it's doing a login every time. The next release should have it caching session cookies, which will make it much more snappy.

      There's also plenty of fat that can be cut from the dependency chain. I wrote the code so I could get it working quickly.

      The new release will probably be up about 30 minutes after I get sick of `idone` being too slow. :)

      Delete
    2. So it goes, my friend. So it goes.

      But geez, 99 dependencies! And for now, installing perlbrew (sweet wrappers for what I assume is local::lib, I was able to get it running on Perl 5.16.2.

      I *also* had to:

      cpanm LWP::Protocol::https

      ...and whoa, sweet, it works! I typed `idone "Installed idone."`, waited a few seconds, and it did its magic. That actually doesn't take too long in my opinion. 3-5 seconds, but it's in an infrequent action. I am used to that wait with rumember and instapaper (https://github.com/jordelver/instapaper).

      I'm @wizonesolutions on Twitter so just hit me up if you need feedback on something, if an update comes out, etc.!

      Delete
  3. So you might want to look at App::local::lib::helper. It provides some nice utilities that can turn:

    cpanm --local-lib=~/perl5 local::lib && \
    eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)

    into

    cpanm -L perl5/ App::local::lib::helper && source perl5/bin/localenv-bashrc

    which I quite prefer.

    ReplyDelete
  4. perigrin: Thanks for the tip. perlbrew has been working fantastically on my Mac.

    ReplyDelete