-
-
Save sanderdg/1219742 to your computer and use it in GitHub Desktop.
Script to automatically export simplenote data from http://simplenote-backup.appspot.com/
This file contains 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-export.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 => 'txt').first.check | |
agent.submit(export_form, export_form.buttons.first).body | |
pickup = agent.get("http://simplenote-export.appspot.com/pickup").form("loginform") | |
pickup.email = email | |
pickup.password = password | |
pickup_form = agent.submit(pickup, pickup.buttons.first).form("serveexport") | |
download = agent.submit(pickup_form, pickup_form.buttons.first).body | |
puts download |
Hi there,
Super beginner here. What's the easiest way to run this?
Thx!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated the version of ktheory so that it works again; my first script in Ruby :)