Skip to content

Instantly share code, notes, and snippets.

@ktheory
Created December 2, 2010 23:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ktheory/726296 to your computer and use it in GitHub Desktop.
Save ktheory/726296 to your computer and use it in GitHub Desktop.
Script to automatically export simplenote data from http://simplenote-backup.appspot.com/
#!/usr/bin/env ruby
require 'rubygems'
require 'mechanize'
require 'yaml'
config = YAML.load_file(File.expand_path("~/.simple-note-backup.yml"))
email = config['email']
password = config['password']
agent = Mechanize.new
login = agent.get("http://simplenote-backup.appspot.com/").form("loginform")
login.email = email
login.password = password
export_form = agent.submit(login, login.buttons.first).form("export")
export_form.radiobuttons_with(:value => 'json').first.check
json = agent.submit(export_form, export_form.buttons.first).body
puts json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment