Peter Hoffmann on Stackoverflow @peterhoffmann on twitter Peter Hoffmann on Facebook Contact me per email Subscribe to Atom Feed

Peter Hoffmann

Software Engineer
prev page next page

send notes to simplenote from the command line and vim

Posted on August 13, 2011
#python is a command line app to send text to simplenote service. It uses the library.:

#!/usr/bin/env python
"""simplenote command line app"""

import sys
import fileinput

from simplenote import Simplenote
sn = Simplenote("XXX", "XXX")

def send(txt):
    note = {'content': txt}
    note, status = sn.add_note(note)

    if status != 0:
        print >> sys.stderr, note

def read_until_dot():
    line = raw_input()
    while line != ".":
        yield line
        line = raw_input()

import sys
def main(argv=None):
    if argv is None:
        argv = sys.argv

    if len(argv) == 1:
        lines = read_until_dot()
        lines = fileinput.input()


if __name__ == '__main__':


Enter a note:

write text
you want to send to simplenote
end note with one . in line

Pipe the output from another commant to simplenote:

$ echo "send output from command" | -

Send the contents from a file to simplenote:

$ some_text_file.txt


There is the simplenote.vim plugin. It lets you interact with simplenote. If you just want a quick way to send notes to simplenote use the following commands:

Send the current buffer to simplenote:

:%w ! -

Send the current selection to simplenote:

:'<,'>w ! -