Created
June 5, 2011 21:14
-
-
Save levity/1009426 to your computer and use it in GitHub Desktop.
more mechanize: mass-adjust meetup communication settings
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/ruby | |
require 'rubygems' | |
require 'mechanize' | |
print "email: " | |
email = gets.chomp | |
print "password: " | |
password = gets.chomp | |
agent = Mechanize.new | |
agent.get 'https://secure.meetup.com/login' | |
agent.page.forms.first.tap do |f| | |
f.set_fields :email => email, :password => password | |
f.submit | |
end | |
agent.get 'http://www.meetup.com/account/comm/' | |
links = agent.page.links_with :text => 'Edit communication settings' | |
links.each do |link| | |
print "#{link.href}... " | |
agent.get link.href | |
agent.page.forms.first.tap do |f| | |
# no message board updates (for those meetups that have one) | |
f.checkboxes.detect{|c| c.node[:id] == 'updates'}.tap{|c| c.uncheck if c} | |
# no event reminders | |
f.checkbox_with(:name => 'evRemind').uncheck | |
f.submit | |
end | |
puts 'ok' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
to unsubscribe from a meetup group completely: