Last active
August 29, 2015 14:22
-
-
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.
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
| 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