Created
December 2, 2010 23:11
-
-
Save ktheory/726296 to your computer and use it in GitHub Desktop.
Script to automatically export simplenote data from http://simplenote-backup.appspot.com/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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