Skip to content

Instantly share code, notes, and snippets.

@tatey
Last active November 1, 2022 07:33
Show Gist options
  • Save tatey/03dbce9c5b032a917ddf1f7469ccaa57 to your computer and use it in GitHub Desktop.
Save tatey/03dbce9c5b032a917ddf1f7469ccaa57 to your computer and use it in GitHub Desktop.
A quick script to enable "all access" on a bunch of projects
let
nixpkgs =
import (builtins.fetchTarball {
url = https://github.com/NixOS/nixpkgs/archive/e6e6bad81b7e11f37d893ef39712ce8918ae2338.tar.gz;
}) { };
in
nixpkgs.mkShell {
buildInputs = [
nixpkgs.chromedriver
nixpkgs.ruby_3_1
];
}
source "https://rubygems.org"
gem "capybara"
gem "debug"
gem "selenium-webdriver"
require "bundler/setup"
require "capybara"
require "capybara/dsl"
require "debug"
PROJECT_URLS = %w[
https://3.basecamp.com/.../edit
]
include Capybara::DSL
Capybara.default_driver = :selenium_chrome
Capybara.reset_sessions!
visit "https://3.basecamp.com/..."
fill_in "Email or username", with: "[email protected]"
click_on "Next"
fill_in "Password", with: STDIN.gets
fill_in "Authentication code", with: STDIN.gets
click_on "Verify"
PROJECT_URLS.each do |project_url|
visit "#{project_url}/edit"
find("#project_admissions_team", visible: false).send(:parent).send(:parent).click
click_on "Save changes"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment