Those who follow my blog know that I have acquired an iTouch and that I use the popular Simplenote (
http://simplenoteapp.com/) application for notes. It synchronizes with its own Website, which can be accessed in various ways. See
http://takingnotenow.blogspot.com/2010/02/simplenote-and-chrome.html and
http://takingnotenow.blogspot.com/2010/02/simple-ahk-script-for-simplenote-and.html. I have now hacked a Python script that displays the notes in ConnectedText. Here it is:
<% Python
from urllib import urlopen # standard Python library
from base64 import b64encode # standard Python library
import simplejson # http://code.google.com/p/simplejson/
# Login credentials.
email = 'someone@somewhere.edu'
password = 'sekreet'
# Get my authorization token for later calls.
loginURL = 'https://simple-note.appspot.com/api/login'
creds = b64encode('email=%s&password=%s' % (email, password))
login = urlopen(loginURL, creds)
token = login.readline().rstrip()
login.close()
# Get the note index.
indexURL = 'https://simple-note.appspot.com/api/index?auth=%s&email=%s' % (token, email)
index = urlopen(indexURL)
noteList = simplejson.load(index)
baseURL = 'https://simple-note.appspot.com/api/note?key=%s&auth=%s&email=%s'
for i in noteList:
noteURL = baseURL % (i['key'], token, email)
title = urlopen(noteURL).readline().decode('utf-8').rstrip()[:40]
text = urlopen(noteURL).readlines()
if i['deleted'] == False:
print "===" + title + "==="
for line in text:
print line
%>
It's based on this script:
http://www.leancrew.com/all-this/2010/01/exploring-the-simplenote-api/. I am sure it can be improved upon, as I am not very familiar at all with Python.
But I thought that someone with an iTouch and ConnectedText might find it useful, as the RSS feed does not work with the Website.
I only need the Simplenotes notes to show up in ConnectedText (and not the other way around), as I am using Simplenote only for notes I take on the road, which I then put into ConnectedText for permanent storage.
Manfred
PS: Adding [1:] after for line in text ==> "for line in text[1:]:" will suppress the title in the body of the note (Simplenote simply uses the first line as title).