Home > Web開発, 携帯サイト開発 > 携帯サイト開発 その2 IPアドレスレンジ 
ネタ蔵キーワード:携帯電話 [グッズ]

携帯サイト開発 その2 IPアドレスレンジ 
ネタ蔵キーワード:携帯電話 [グッズ]

tracert
Creative Commons License photo credit: pixle

携帯サイト開発 その1 全キャリア・全機種をゲット」では、「ケータイ端末プロファイルデータ(無償版)」のデータをModify Headersのインポート用データに変換するスクリプトを書きました。
簡単なものですけど、こういうのは「いちいち書くのは面倒くさい」し、どっかにあればそれを使いたいと思うものですから、テキトーに変更しながら使ってもらえればと思います。

今回は、これまた「いちいち書くのは面倒くさい」シリーズで、「各キャリアのIPレンジ(ネットワーク)をデータベースに放り込んでおく」って奴です。

といっても、PHPスクリプトじゃなくて、SQL文。
ま、MySQLを使っている人も、PostgreSQLを使っている人も、SQLiteを使っている人も、みんな使いまわせるように書いてみました。

テーブル定義はなし。
テーブル名は「mobile_networks」。
フィールドは便宜的に「career」と「network」とし、それぞれTEXTフィールドってことで。

以下はそれを埋めるINSERT文のセットです。
自身のテーブル定義に合わせて書き換えて使ってください。
「career」は「ケータイ端末プロファイルデータ(無償版)」で使われている文字列を採用してます。

もちろん、情報は「2008年11月19日」時点のモノ。

このデータ書くのに、1時間ちょっとかかりました。
みなさん、その時間をこれで節約・・・エコですね(w・・・してくださいませ。
WILLCOMがやたらとIPを使っているのがビックリですね。

ちなみに、このIPアドレスレンジの情報も、今後増えていくわけですね。
ケータイ端末プロファイルデータ(無償版)」のデータ(なんに使ってもいいって規約に書いてあるし)と、このIPアドレスレンジ情報は、ボクとnetaryoくんが今作っているオンラインデータベースサービスの公開データとして登録しようと思います。
みなさんは、このサービスからRESTで最新データをひっぱってこれるようになり、手作業でやっていたことが全部自動でできるようになるはず。
年内にはサービスをスタートするつもりですので、ご期待ください。
サービス開始するときにはまたお知らせしますよ。

INSERT INTO mobile_networks (career, network) VALUES ('DoCoMo','210.153.84.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('DoCoMo','210.136.161.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('DoCoMo','210.153.86.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('DoCoMo','124.146.174.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('DoCoMo','124.146.175.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('au','210.169.40.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('au','210.196.3.192/26');
INSERT INTO mobile_networks (career, network) VALUES ('au','210.196.5.192/26');
INSERT INTO mobile_networks (career, network) VALUES ('au','210.230.128.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('au','210.230.141.192/26');
INSERT INTO mobile_networks (career, network) VALUES ('au','210.234.105.32/29');
INSERT INTO mobile_networks (career, network) VALUES ('au','210.234.108.64/26');
INSERT INTO mobile_networks (career, network) VALUES ('au','210.251.1.192/26');
INSERT INTO mobile_networks (career, network) VALUES ('au','210.251.2.0/27');
INSERT INTO mobile_networks (career, network) VALUES ('au','211.5.1.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('au','211.5.2.128/25');
INSERT INTO mobile_networks (career, network) VALUES ('au','211.5.7.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('au','218.222.1.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('au','61.117.0.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('au','61.117.1.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('au','61.117.2.0/26');
INSERT INTO mobile_networks (career, network) VALUES ('au','61.202.3.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('au','219.108.158.0/26');
INSERT INTO mobile_networks (career, network) VALUES ('au','219.125.148.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('au','222.5.63.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('au','222.7.56.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('au','222.5.62.128/25');
INSERT INTO mobile_networks (career, network) VALUES ('au','222.7.57.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('au','59.135.38.128/25');
INSERT INTO mobile_networks (career, network) VALUES ('au','219.108.157.0/25');
INSERT INTO mobile_networks (career, network) VALUES ('au','219.125.151.128/25');
INSERT INTO mobile_networks (career, network) VALUES ('au','219.125.145.0/25');
INSERT INTO mobile_networks (career, network) VALUES ('au','121.111.231.0/25');
INSERT INTO mobile_networks (career, network) VALUES ('au','121.111.231.160/27');
INSERT INTO mobile_networks (career, network) VALUES ('au','121.111.227.0/25');
INSERT INTO mobile_networks (career, network) VALUES ('au','121.111.227.160/27');
INSERT INTO mobile_networks (career, network) VALUES ('SoftBank','123.108.236.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('SoftBank','123.108.237.0/27');
INSERT INTO mobile_networks (career, network) VALUES ('SoftBank','202.179.204.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('SoftBank','202.253.96.224/27');
INSERT INTO mobile_networks (career, network) VALUES ('SoftBank','210.146.7.192/26');
INSERT INTO mobile_networks (career, network) VALUES ('SoftBank','210.146.60.192/26');
INSERT INTO mobile_networks (career, network) VALUES ('SoftBank','210.151.9.128/26');
INSERT INTO mobile_networks (career, network) VALUES ('SoftBank','210.169.130.112/28');
INSERT INTO mobile_networks (career, network) VALUES ('SoftBank','210.175.1.128/25');
INSERT INTO mobile_networks (career, network) VALUES ('SoftBank','210.228.189.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('SoftBank','211.8.159.128/25');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.142.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','219.108.14.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.161.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','219.108.0.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.249.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','219.108.1.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.250.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','219.108.2.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.253.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','219.108.3.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.254.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','219.108.4.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.255.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','219.108.5.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.204.3.0/25');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','219.108.6.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.204.4.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','221.119.0.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.204.6.0/25');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','221.119.1.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','125.28.4.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','221.119.2.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','125.28.5.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','221.119.3.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','125.28.6.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','221.119.4.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','125.28.7.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','221.119.5.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','125.28.8.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','221.119.6.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','211.18.235.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','221.119.7.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','211.18.238.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','221.119.8.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','211.18.239.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','221.119.9.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','125.28.11.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','125.28.13.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','125.28.12.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','125.28.14.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','125.28.2.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','125.28.3.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','211.18.232.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','211.18.233.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','211.18.236.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','211.18.237.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','125.28.0.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','125.28.1.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.204.0.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','210.168.246.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','210.168.247.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','219.108.7.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.204.2.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.204.5.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.129.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.140.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.141.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','125.28.15.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.165.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.166.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.168.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.169.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.170.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.248.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','125.28.16.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','125.28.17.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','211.18.234.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','219.108.8.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','219.108.9.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','219.108.10.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.138.100/32');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.138.101/32');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.138.102/32');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.139.160/28');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.139.128/27');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.138.103/32');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.139.0/29');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','219.108.15.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.130.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.163.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.204.6.128/25');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.204.7.0/25');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.204.92.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.204.93.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.204.94.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.204.95.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.128.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.131.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.143.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.172.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.173.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.252.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.204.3.128/25');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','211.126.192.128/25');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','219.108.11.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','219.108.12.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','219.108.13.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.132.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.133.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.134.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.135.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.136.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.137.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.160.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.162.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.164.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.171.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.174.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.175.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','61.198.251.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','210.169.92.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','210.169.93.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','210.169.94.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','210.169.95.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','210.169.96.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','210.169.97.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','210.169.98.0/24');
INSERT INTO mobile_networks (career, network) VALUES ('WILLCOM','210.169.99.0/24');

netazo Web開発, 携帯サイト開発 ,

  1. No comments yet.
-->
-->