Sha256: 73c972737c3272c0c2c83847feb2aa9f51326e6e1db46987d93cdd0a591fba5b

Contents?: true

Size: 544 Bytes

Versions: 1

Compression:

Stored size: 544 Bytes

Contents

#!/usr/bin/env ruby -Ku
# willcomのwebページからIPリストを抽出する場当たり的なスクリプト。

require 'kconv'
require 'open-uri'
require 'pp'

src = open("http://www.willcom-inc.com/ja/service/contents_service/club_air_edge/for_phone/ip/index.html").read.toutf8

ips = src.scan(/(\d+\.\d+\.\d+\.\d+\/\d+)/).flatten

# 書き出し
open("lib/jpmobile/mobile/z_ip_addresses_willcom.rb","w") do |f|
  f.puts "Jpmobile::Mobile::Willcom::IP_ADDRESSES ="
  f.puts "#{ips.pretty_inspect.chomp }.map {|ip| IPAddr.new(ip) }"
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jpmobile-0.0.3 tools/update_ip_addresses_willcom.rb