Skip to content

Instantly share code, notes, and snippets.

@tylerpearson
Last active August 29, 2015 14:22
Show Gist options
  • Select an option

  • Save tylerpearson/7c85568d240c0c4435ee to your computer and use it in GitHub Desktop.

Select an option

Save tylerpearson/7c85568d240c0c4435ee to your computer and use it in GitHub Desktop.
Ruby Capybara script to trigger a dump of Parse data. For example, this could be used nightly to get a backup.
require 'cgi'
require 'timeout'
require 'capybara'
class ParseDownloader
include Capybara::DSL
def initialize(email, password, app_name)
Capybara.default_driver = :selenium
@email = email
@password = password
@app_name = app_name
end
def get_dump
puts "Starting..."
link = "https://www.parse.com/login"
visit link
fill_in 'user_session_email', with: @email
fill_in 'user_session_password', with: @password
find('.submit', :text=>"Log in").click
click_link 'sweeble_prod'
click_link 'Settings'
click_link 'Export data'
click_link 'Export Data'
puts "Download triggered"
end
end
# email, password, app name
ParseDownloader.new('email@sample.com', 'password', 'app_name').get_dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment