OpenSUSE: Getting to work the ruby script to login into dyndns.com automatically every week.
Posted by jpluimers on 2015/01/06
So I remember for the next time:
zypper install ruby
zypper install ruby-devel
zypper install gcc
zypper install gcc-c++
If you don’t install all these, them the gem will fail with errors like this:
ERROR: Failed to build gem native extension.
/usr/lib64/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
What helps a lot for sorting out the above error messages is the Zypper Cheat Sheet (PDF).
But zypper was not enough as still it failed:
gem install mechanize
will eventually end with:
No such file or directory - getcwd
That was solved by running these two:
gem update
gem update --system
So I could install mechanize:
gem install mechanize
Now this works:
This file contains 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 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 |
which works around the dyndns problem at
Looking for a new Dynamic DNS provider for FritzBox 7340 and ASUS RT N66U.
–jeroen
via: Script to login into dyndns.com automatically every week..
IL said
Well, great, but dyndns has discontinued its free service some time ago, hasn’t it?