Sublime Forum

Simplenote plugin

#1

Hi, All.

I’ve put together a plugin for interacting with a SimpleNote account (simplenoteapp.com/). Basically, it’s an iPhone note-taking app that syncs to the cloud. This plugin allows you to pull down a note from the site, edit in sublime, and when you hit ‘save’, it’ll upload it back to the site. It basically gives you a shared note store between an iPhone and Sublime.

There’s a little bit of config. You need to add a file containing your simplenote email address and password in %APPDATA%\simplenote-api-key.txt, with contents like

username:hektor@troy.com
password:mypassword
working directory:c:\\temp
editor extension: txt

It’s available on bitbucket at bitbucket.org/stevecooperorg/simplenote/src

Enjoy.

0 Likes

#2

Nice!

0 Likes

#3

Hi, I’m super keen to get this plugin working, but havent had much luck.

I’m not getting any errors in the console when I load sublime, but the ‘List Simplenotes’ option under tools is greyed out. I’ve formatted/located the api-key file correctly…

Are there some OS/python/simplenote account requirements that I’m missing? Perhaps I should try hardcoding my account details, or using the first version from the repository?

Any help would be greatly appreciated :smile: I am a massive fan of both Sublime and simplenote.

EDIT: seems to be based around python being unable to import the json module, ie:

import json
ImportError: No module named json

Odd though - im runnng python 2.6.4; and running test_json.py comes back positive

0 Likes

#4

The json module only appeared in Python 2.6, which means you’ll need the beta version (sublimetext.com/beta) of Sublime Text for it to work: Sublime Text 1.3 is still using Python 2.5.

0 Likes

#5

Ah, of course. Thanks so much for your help, it works great!

0 Likes

#6

@ulterior – glad you got it working. Let me know how it goes.

@jps – thanks for helping, Jon!

0 Likes

#7

Any way to get this working from behind a corporate proxy?

By the way, the plugin doesn’t handle the missing configuration file very well.

Otherwise, I’m curious to see this working…

0 Likes

#8

@jbjornson – I’ve updated the plugin so that there is now a new command in the package menu; you can now click through “Tools | Packages | Simplenote | Edit Simplenote Config File” and it will open the config file. If that doesn’t yet exist, it will be created and it’s up to you to fill in the username, password, and working directory. After changes, you’ll need to restart ST to have them take effect. Hopefully that makes it easier to get the file in the right place and in the right format.

What’s happening on your corporate proxy? I don’t think there’s anything going on except standard web traffic, albeit over HTTPS. The URLs used all look something like

https://simple-note.appspot.com/api/login

So you may want to make sure traffic to this site, and over HTTPS, is allowed.

0 Likes

#9

I did eventually get the config file in the right location but what I meant before is that the error handling wasn’t very graceful when the config file isn’t there. I’m sure the config file editor will be helpful when setting up the plugin. Thanks.

The corporate proxy requires that all internet traffic going outside of the intranet is directed through a proxy that is authenticated via NTLM. The connection to to the http/https site has to be done through the proxy. All traffic to the “outside world” is blocked unless it goes through the proxy. I guess there should be some way to define the proxy url and port for the connection that you are making to the simple-note api on…

0 Likes

#10

@jbjornson;

I’m not sure how to proceed with this, really – this is outside my experience and I don’t have a proxy to try it with. If you wanted to try to write a patch, I could suggest a few places in the code you’d want to edit. Here’s what I got so far;

in simplenote.py, changeset 2 (3b7dacd23edc);

on line 1, start using urllib2, which supports proxies;

-from urllib import urlopen
+from urllib2 import urlopen

line 385; add proxy option loading code like;

if 'proxy url' in d: self.proxy= d'proxy url']

which will add those properties to the setup object. Then at the end of Load(), if the proxy was specified, add your authentication code;

from http://bytes.com/topic/python/answers/22918-proxy-authentication-using-urllib2;

[code]# set up authentication info
authinfo = urllib2.HTTPBasicAuthHandler()
authinfo.add_password(‘realm’, ‘host’, ‘username’, ‘password’)
proxy_support = urllib2.ProxyHandler({“http” : “http://ahad-haam:3128”})

build a new opener that adds authentication and caching FTP handlers

opener = urllib2.build_opener(proxy_support, authinfo,
urllib2.CacheFTPHandler)

install it

urllib2.install_opener(opener)
[/code]

I’ve not tried this at all, but I thought I’d dump all the thinking I’ve done here. Let me know how it goes; if you do get it to work, post the patch here and I’ll update.

0 Likes

#11

You can also try this, although I don’t know how it works with authentication:

import os os.environ'https_proxy'] = 'http://myproxy.com/' os.environ'http_proxy'] = 'http://myproxy.com/'

0 Likes

#12

Hi,

is anybody still using this plugin with a recent version?

I’ve put all files in a directory “simplenote” into the packages folder. Sublime can’t parse the Default.sublime-keymap:1:1

I guess the syntax for key bindings has changed at some point!?

But even without key bindings shouldn’t there be any simplenote entries in the command palette?

0 Likes

#13

From the age of the posts & the repository (2010 and earlier), my guess is that this plugin was written for Sublime Text 1.

0 Likes

#14

I don’t know what all the cool kinds are doing these days, but I’m warming up to the idea of using SimpleNote to sync notes across devices (rather than vanilla Dropbox). But I am loathe to write in anything other than Sublime. Am I the only one in this boat? Or are there other people interested in ressurecting this plugin? (I’m not offering, incidentally :smile: )

0 Likes

#15

Nice thing. Thanks!

0 Likes