-
-
Save meise/5585311 to your computer and use it in GitHub Desktop.
Script to login into dyndns.com automatically every week.
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
@weekly /usr/local/bin/ruby ~/dyndns_login.rb |
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/env ruby | |
# encoding: utf-8 | |
require 'mechanize' | |
NAME = 'foo' | |
PASSWORD = 'baz' | |
agent = Mechanize.new | |
agent.user_agent = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0' | |
login_page = agent.get('https://account.dyn.com/entrance/') | |
result_login = login_page.form_with(action: '/entrance/') do |form| | |
form.username = NAME | |
form.password = PASSWORD | |
end.click_button |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Really useful, thanks a mil!