Home, Up

SimplenoteWatch

March 2012

This page was written a couple of years ago and is vastly outdated. The linked Perl script still works (again), but it is really a bad hack and I don't use it anymore. However, it is still a neat idea to watch for changes in your Simplenote account (Hello NoteTote!), so I keep this page available.




November 2009

Goal

Watch for changes in your Simplenote account and trigger user-defined actions based on the changes. For example, you can edit a note in Simplenote and it is automatically published to the web after a minute or two. Or export your notes to another notetaking system. Or backup your notes as revisions every other minute.

What is SimplenoteWatch.pl ?

SimplenoteWatch.pl is a Perl script which checks your notes in Simplenote for a special tag inside your note, e.g. [SimplenoteWatch][youraction]. If there is such a tag, a program of your choice is started on your machine with the note's content and unique ID as parameters. Your program of choice is only started if the note has actually changed on the server.

Sample Scenarios

  1. Publish a note with Markdown syntax on the web. Actually, this very webpage is created from a Simplenote note and is updated as soon as I edit the note on my iPhone or in the webapp.
  2. Mirror some of your notes to Evernote. Updates to your notes will be updated in Evernote (one-way sync).
  3. Backup revisions of your note on your server.
  4. ...

How-To

  1. Install the script on your Linux/Unix machine. Mac OS should work
  2. Make sure you have the Perl dependencies satisfied, especially YAML and Crypt::SSLeay. All modules can be installed using CPAN.
  3. Think about what you want to do with your notes. Let's assume you want to save all revisions of your notes every other minute. So, you write a short program/script called simplerevision, which takes the following arguments:

    simplerevision <notefile.txt> <note-key>

The program takes a file with the note's content and its unique ID provided by Simplenote. The program may store the revision into a place such as $HOME/simplerevision/<note-key>/<current-date-time>.txt where <note-key> is the unique ID and <current-date-time> refers to a time-based string like 20091103-1023. 4. Put a file called .simplenotaction.yml in your $HOME directory. Check here for a sample file.

       email: user@example.com
       password: <confidential>
       cmds:
         revision: /path/to/program/simplerevision
  1. Create a note with the text [SimplenoteWatch][revision] somewhere.
  2. Test your script by running SimplenoteWatch.pl
  3. Create a crontab entry which starts SimplenoteWatch every other minute
  4. You may create other programs which do something with your notes. Just add them to the cmds section of the setup file.

TODO

Short term

Long term

Acknowledgments

Part of the sourcecode is based on SimplenoteSync (fletcherpenney.net).

Author

Stephan
E-Mail: mail@ping13.net
Twitter: ping13

Last modification: Mon Mar 5 10:30:14 CET 2012


Comments? Feedback?

Tweet  about it and mention my Twitter account @ping13 or send an e-mail to mail@ping13.net.
Home, Up