#!/usr/local/bin/ruby # # TE4121C用グローバルIP取得スクリプト # # require 'net/http' #更新 def update() Net::HTTP.start('ddo.jp',80){|http| response = http.get('/dnsupdate.php?dn=XXXX&pw=XXXX') } end Net::HTTP.version_1_2 req = Net::HTTP::Get.new('/cgi-bin/main.cgi?cc_webname=STATUS') req.basic_auth 'user', 'user' Net::HTTP.start('192.168.1.1') {|http| response = http.request(req) i = response.body.index("ADSL") i = response.body.index(":",i) e= response.body.index("