The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,262 other subscribers

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:


@weekly /usr/local/bin/ruby ~/dyndns_login.rb

view raw

cron

hosted with ❤ by GitHub


#!/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

view raw

dyndns_login.rb

hosted with ❤ by GitHub

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..

One Response to “OpenSUSE: Getting to work the ruby script to login into dyndns.com automatically every week.”

  1. IL said

    Well, great, but dyndns has discontinued its free service some time ago, hasn’t it?

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.