まずはその取っ掛かりとして、PythonとRubyでグローバルIPを拾う所まで。
まずはPythonから。
1 | #!/usr/bin/env python |
2 | # -*- coding: utf-8 -*- |
3 |
4 | import commands |
5 |
6 | ip = commands.getoutput('wget - q - O - ipcheck.ieserver.net') |
7 | print ip, |
1 | #! /usr/bin/env ruby |
2 | # -*- coding: utf-8 -*- |
3 |
4 | ip = `wget -q -O - ipcheck.ieserver.net` |
5 | puts ip |
0 件のコメント:
コメントを投稿