{"id":362,"date":"2014-02-22T01:17:15","date_gmt":"2014-02-21T16:17:15","guid":{"rendered":"http:\/\/lovelinux.mydns.jp\/?p=362"},"modified":"2014-03-21T17:20:19","modified_gmt":"2014-03-21T08:20:19","slug":"ruby-%e3%81%a7-ip%e3%82%a2%e3%83%89%e3%83%ac%e3%82%b9%e3%81%8b%e3%82%89%e3%83%ad%e3%82%b1%e3%83%bc%e3%82%b7%e3%83%a7%e3%83%b3%e6%83%85%e5%a0%b1%e3%82%92%e6%8b%be%e3%81%a3%e3%81%a6%e3%81%bf%e3%82%8b","status":"publish","type":"post","link":"https:\/\/lovelinux.mydns.jp\/?p=362","title":{"rendered":"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b"},"content":{"rendered":"<p>\u306a\u3093\u3068\u306a\u304f\u3067\u304d\u308b\u304b\u306a\u3068\u601d\u3063\u3066\u8a66\u3057\u305f\u3089\u3001Mechanize\u3067\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u305f\u306e\u3067\u7d39\u4ecb\u3002<\/p>\n<p>\u4ee5\u4e0b\u306e\u30bd\u30fc\u30b9\u3092 test.rb\u306a\u3069\u3068\u3057\u3066\u4fdd\u5b58\u3057\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u5f15\u6570\u306bIP\u30a2\u30c9\u30ec\u30b9\u3092\u4e0e\u3048\u3066\u5b9f\u884c\u3059\u308b\u3068\u3001\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u51fa\u529b\u3059\u308b\u3002\u5b9f\u88c5\u65b9\u6cd5\u306fWeb\u3067\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u63d0\u4f9b\u3057\u3066\u3044\u308b\u30da\u30fc\u30b8\u306b\u5bfe\u3057\u3066\u3001POST\u3067\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u6295\u3052\u3064\u3051\u3066\u3001Response\u3092\u62fe\u3046\u3068\u3044\u3046\u65b9\u5f0f\u3002\u306a\u306e\u3067\u3001\u30eb\u30fc\u30d7\u51e6\u7406\u306a\u3069\u3067\u3084\u305f\u3089\u3081\u3063\u305f\u3089\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u6295\u3052\u7d9a\u3051\u305f\u3089\u3001\u591a\u5206\u6587\u53e5\u8a00\u308f\u308c\u307e\u3059\u306e\u3067\u3001\u5229\u7528\u306f\u307b\u3069\u307b\u3069\u306b\u3002<\/p>\n<p>\u7b2c\u4e00\u5f15\u6570\uff1a IP\u30a2\u30c9\u30ec\u30b9<br \/>\n\u7b2c\u4e8c\u5f15\u6570\uff1a \u30b5\u30a4\u30c8No (1 or 2  default 1)<\/p>\n<h4>\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9 \uff08test.rb\uff09<\/h4>\n<p>[ruby]<\/p>\n<p>require &#8216;mechanize&#8217;<br \/>\nrequire &#8216;json&#8217;<br \/>\nclient = Mechanize.new<\/p>\n<p>ipaddr =  ARGV[0]<br \/>\nsiteno = ARGV[1].nil? ? 1 : ARGV[1]<\/p>\n<p>pp &#8220;siteno=&#8221; + siteno.to_s<\/p>\n<p>if siteno == 1<br \/>\n\turl = &#8220;http:\/\/ip2loc.jerodsanto.net\/lookup&#8221;<br \/>\n\tret = client.post(url,{ip: ipaddr})<br \/>\nelse<br \/>\n\turl = &#8220;http:\/\/www.yougetsignal.com\/tools\/network-location\/php\/get-network-location-json.php&#8221;<br \/>\n\tret = client.post(url,{remoteAddress:ipaddr,geoSource:&#8221;geoip&#8221;})<\/p>\n<p>end<\/p>\n<p>json_data = JSON.parse(ret.body)<\/p>\n<p>json_data.each do |key,value|<br \/>\n  p key + &#8220;&#8211;&#8221; + value.to_s<\/p>\n<p>end<\/p>\n<p>[\/ruby]<\/p>\n<h4>\u5b9f\u884c\u7d50\u679c1 (ip2loc.jerodsanto.net\u3092\u5229\u7528\uff09<\/h4>\n<p>[bash]<br \/>\n$ ruby test.rb 42.83.7.20 1<br \/>\n&#8220;siteno=1&#8221;<br \/>\n&#8220;request&#8211;42.83.7.20&#8221;<br \/>\n&#8220;ip&#8211;42.83.7.20&#8221;<br \/>\n&#8220;country_code2&#8211;JP&#8221;<br \/>\n&#8220;country_code3&#8211;JPN&#8221;<br \/>\n&#8220;country_name&#8211;Japan&#8221;<br \/>\n&#8220;continent_code&#8211;AS&#8221;<br \/>\n&#8220;region_name&#8211;25&#8221;<br \/>\n&#8220;city_name&#8211;Miyazaki&#8221;<br \/>\n&#8220;postal_code&#8211;&#8221;<br \/>\n&#8220;latitude&#8211;31.911100000000005&#8221;<br \/>\n&#8220;longitude&#8211;131.4239&#8221;<br \/>\n&#8220;dma_code&#8211;&#8221;<br \/>\n&#8220;area_code&#8211;&#8221;<br \/>\n&#8220;timezone&#8211;Asia\/Tokyo&#8221;<br \/>\n[\/bash]<\/p>\n<h4>\u5b9f\u884c\u7d50\u679c\uff12 (www.yougetsignal.com\u3092\u5229\u7528\uff09<\/h4>\n<p>[bash]<\/p>\n<p>$ ruby test.rb 42.83.7.20 2<br \/>\n&#8220;siteno=2&#8221;<br \/>\n&#8220;status&#8211;Success&#8221;<br \/>\n&#8220;ipAddress&#8211;42.83.7.20&#8221;<br \/>\n&#8220;hostname&#8211;42-83-7-20.btvm.ne.jp&#8221;<br \/>\n&#8220;baseDomain&#8211;ne.jp&#8221;<br \/>\n&#8220;countryCode&#8211;Unknown&#8221;<br \/>\n&#8220;countryFlag&#8211;&lt;img src=\\&#8221;\/img\/flags\/.gif\\&#8221; alt=\\&#8221;\\&#8221; \/&gt;&#8221;<br \/>\n&#8220;countryName&#8211;Unknown&#8221;<br \/>\n&#8220;region&#8211;Unknown&#8221;<br \/>\n&#8220;city&#8211;Unknown&#8221;<br \/>\n&#8220;latitude&#8211;Unknown&#8221;<br \/>\n&#8220;longitude&#8211;Unknown&#8221;<br \/>\n&#8220;areaCode&#8211;Unknown&#8221;<br \/>\n&#8220;postalCode&#8211;Unknown&#8221;<br \/>\n[\/bash]<\/p>\n<p>\u4ee5\u4e0a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306a\u3093\u3068\u306a\u304f\u3067\u304d\u308b\u304b\u306a\u3068\u601d\u3063\u3066\u8a66\u3057\u305f\u3089\u3001Mechanize\u3067\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u305f\u306e\u3067\u7d39\u4ecb\u3002 \u4ee5\u4e0b\u306e\u30bd\u30fc\u30b9\u3092 test.rb\u306a\u3069\u3068\u3057\u3066\u4fdd\u5b58\u3057\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u5f15\u6570\u306bIP\u30a2\u30c9\u30ec\u30b9\u3092\u4e0e\u3048\u3066\u5b9f\u884c\u3059\u308b\u3068\u3001\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u51fa\u529b\u3059\u308b\u3002\u5b9f\u88c5\u65b9\u6cd5\u306fWeb\u3067\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u63d0\u4f9b\u3057\u3066\u3044\u308b\u30da\u30fc\u30b8\u306b\u5bfe\u3057\u3066\u3001POST\u3067\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u6295\u3052\u3064\u3051\u3066\u3001Response\u3092\u62fe\u3046\u3068\u3044\u3046\u65b9\u5f0f\u3002\u306a\u306e\u3067\u3001\u30eb\u30fc\u30d7\u51e6\u7406\u306a\u3069\u3067\u3084\u305f\u3089\u3081\u3063\u305f\u3089\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u6295\u3052\u7d9a\u3051\u305f\u3089\u3001\u591a\u5206\u6587\u53e5\u8a00\u308f\u308c\u307e\u3059\u306e\u3067\u3001\u5229\u7528\u306f\u307b\u3069\u307b\u3069\u306b\u3002 \u7b2c\u4e00\u5f15\u6570\uff1a IP\u30a2\u30c9\u30ec\u30b9 \u7b2c\u4e8c\u5f15\u6570\uff1a \u30b5\u30a4\u30c8No (1 or 2 default 1) \u30bd\u30fc\u30b9\u30b3\u30fc\u30c9 \uff08test.rb\uff09 [ruby] require &#8216;mechanize&#8217; require &#8216;json&#8217; client = Mechanize.new ipaddr = ARGV[0] siteno = ARGV[1].nil? ? 1 : ARGV[1] pp &#8220;siteno=&#8221; + siteno.to_s if siteno == 1 url = &#8220;http:\/\/ip2loc.jerodsanto.net\/lookup&#8221; ret = client.post(url,{ip: ipaddr}) else url = &#8220;http:\/\/www.yougetsignal.com\/tools\/network-location\/php\/get-network-location-json.php&#8221; ret = client.post(url,{remoteAddress:ipaddr,geoSource:&#8221;geoip&#8221;}) end json_data = JSON.parse(ret.body) json_data.each do |key,value| p key + &#8220;&#8211;&#8221; + value.to_s end [\/ruby] \u5b9f\u884c\u7d50\u679c1 (ip2loc.jerodsanto.net\u3092\u5229\u7528\uff09 [bash] $ ruby test.rb 42.83.7.20 1 &#8220;siteno=1&#8221; &#8220;request&#8211;42.83.7.20&#8221; &#8220;ip&#8211;42.83.7.20&#8221; &#8220;country_code2&#8211;JP&#8221; &#8220;country_code3&#8211;JPN&#8221; &#8220;country_name&#8211;Japan&#8221; &#8220;continent_code&#8211;AS&#8221; &#8220;region_name&#8211;25&#8221; &#8220;city_name&#8211;Miyazaki&#8221; &#8220;postal_code&#8211;&#8221; &#8220;latitude&#8211;31.911100000000005&#8221; &#8220;longitude&#8211;131.4239&#8221; &#8220;dma_code&#8211;&#8221; &#8220;area_code&#8211;&#8221; &#8220;timezone&#8211;Asia\/Tokyo&#8221; [\/bash] \u5b9f\u884c\u7d50\u679c\uff12 (www.yougetsignal.com\u3092\u5229\u7528\uff09 [bash] $ ruby test.rb 42.83.7.20 2 &#8220;siteno=2&#8221; &#8220;status&#8211;Success&#8221; &#8220;ipAddress&#8211;42.83.7.20&#8221; &#8220;hostname&#8211;42-83-7-20.btvm.ne.jp&#8221; &#8220;baseDomain&#8211;ne.jp&#8221; &#8220;countryCode&#8211;Unknown&#8221; &#8220;countryFlag&#8211;&lt;img src=\\&#8221;\/img\/flags\/.gif\\&#8221; alt=\\&#8221;\\&#8221; \/&gt;&#8221; &#8220;countryName&#8211;Unknown&#8221; &#8220;region&#8211;Unknown&#8221; &#8220;city&#8211;Unknown&#8221; &#8220;latitude&#8211;Unknown&#8221; &#8220;longitude&#8211;Unknown&#8221; &#8220;areaCode&#8211;Unknown&#8221; &#8220;postalCode&#8211;Unknown&#8221; [\/bash] \u4ee5\u4e0a<\/p>\n","protected":false},"author":1,"featured_media":416,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[6,2],"tags":[16],"class_list":{"0":"post-362","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-rails","8":"category-2","9":"tag-ruby"},"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.8 - aioseo.com -->\n\t<meta name=\"description\" content=\"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b Mechanize\u3067\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u305f\u306e\u3067\u7d39\u4ecb\u3002 \u4ee5\u4e0b\u306e\u30bd\u30fc\u30b9\u3092 test.rb\u306a\u3069\u3068\u3057\u3066\u4fdd\u5b58\u3057\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u5f15\u6570\u306bIP\u30a2\u30c9\u30ec\u30b9\u3092\u4e0e\u3048\u3066\u5b9f\u884c\u3059\u308b\u3068\u3001\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u51fa\u529b\u3059\u308b\u3002\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"hiroshi\"\/>\n\t<meta name=\"google-site-verification\" content=\"fo5n0bjUdcitu1FsBTJqqwL580wBLhhCM51IEogDt9Y\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/lovelinux.mydns.jp\/?p=362\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.8\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_GB\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Love Linux | enjoy using linux for programming flatform\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b\" \/>\n\t\t<meta property=\"og:description\" content=\"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b Mechanize\u3067\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u305f\u306e\u3067\u7d39\u4ecb\u3002 \u4ee5\u4e0b\u306e\u30bd\u30fc\u30b9\u3092 test.rb\u306a\u3069\u3068\u3057\u3066\u4fdd\u5b58\u3057\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u5f15\u6570\u306bIP\u30a2\u30c9\u30ec\u30b9\u3092\u4e0e\u3048\u3066\u5b9f\u884c\u3059\u308b\u3068\u3001\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u51fa\u529b\u3059\u308b\u3002\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/lovelinux.mydns.jp\/?p=362\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2014-02-21T16:17:15+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2014-03-21T08:20:19+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b Mechanize\u3067\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u305f\u306e\u3067\u7d39\u4ecb\u3002 \u4ee5\u4e0b\u306e\u30bd\u30fc\u30b9\u3092 test.rb\u306a\u3069\u3068\u3057\u3066\u4fdd\u5b58\u3057\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u5f15\u6570\u306bIP\u30a2\u30c9\u30ec\u30b9\u3092\u4e0e\u3048\u3066\u5b9f\u884c\u3059\u308b\u3068\u3001\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u51fa\u529b\u3059\u308b\u3002\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?p=362#article\",\"name\":\"Ruby \\u3067 IP\\u30a2\\u30c9\\u30ec\\u30b9\\u304b\\u3089\\u30ed\\u30b1\\u30fc\\u30b7\\u30e7\\u30f3\\u60c5\\u5831\\u3092\\u62fe\\u3063\\u3066\\u307f\\u308b\",\"headline\":\"Ruby \\u3067 IP\\u30a2\\u30c9\\u30ec\\u30b9\\u304b\\u3089\\u30ed\\u30b1\\u30fc\\u30b7\\u30e7\\u30f3\\u60c5\\u5831\\u3092\\u62fe\\u3063\\u3066\\u307f\\u308b\",\"author\":{\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?author=1#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/wp-content\\\/uploads\\\/2014\\\/02\\\/\\u7bc4\\u56f2\\u3092\\u9078\\u629e_002.png\",\"width\":760,\"height\":344},\"datePublished\":\"2014-02-22T01:17:15+09:00\",\"dateModified\":\"2014-03-21T17:20:19+09:00\",\"inLanguage\":\"en-GB\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?p=362#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?p=362#webpage\"},\"articleSection\":\"rails, \\u30d7\\u30ed\\u30b0\\u30e9\\u30df\\u30f3\\u30b0, ruby\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?p=362#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/lovelinux.mydns.jp\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?cat=2#listItem\",\"name\":\"\\u30d7\\u30ed\\u30b0\\u30e9\\u30df\\u30f3\\u30b0\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?cat=2#listItem\",\"position\":2,\"name\":\"\\u30d7\\u30ed\\u30b0\\u30e9\\u30df\\u30f3\\u30b0\",\"item\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?cat=2\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?cat=6#listItem\",\"name\":\"rails\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?cat=6#listItem\",\"position\":3,\"name\":\"rails\",\"item\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?cat=6\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?p=362#listItem\",\"name\":\"Ruby \\u3067 IP\\u30a2\\u30c9\\u30ec\\u30b9\\u304b\\u3089\\u30ed\\u30b1\\u30fc\\u30b7\\u30e7\\u30f3\\u60c5\\u5831\\u3092\\u62fe\\u3063\\u3066\\u307f\\u308b\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?cat=2#listItem\",\"name\":\"\\u30d7\\u30ed\\u30b0\\u30e9\\u30df\\u30f3\\u30b0\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?p=362#listItem\",\"position\":4,\"name\":\"Ruby \\u3067 IP\\u30a2\\u30c9\\u30ec\\u30b9\\u304b\\u3089\\u30ed\\u30b1\\u30fc\\u30b7\\u30e7\\u30f3\\u60c5\\u5831\\u3092\\u62fe\\u3063\\u3066\\u307f\\u308b\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?cat=6#listItem\",\"name\":\"rails\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?author=1#author\",\"url\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?author=1\",\"name\":\"hiroshi\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?p=362#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/e7c5ca03ae8cd5b5d36ac0f62f59c26d34fd667afa57dafb4978790c04c5146f?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"hiroshi\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?p=362#webpage\",\"url\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?p=362\",\"name\":\"Ruby \\u3067 IP\\u30a2\\u30c9\\u30ec\\u30b9\\u304b\\u3089\\u30ed\\u30b1\\u30fc\\u30b7\\u30e7\\u30f3\\u60c5\\u5831\\u3092\\u62fe\\u3063\\u3066\\u307f\\u308b\",\"description\":\"Ruby \\u3067 IP\\u30a2\\u30c9\\u30ec\\u30b9\\u304b\\u3089\\u30ed\\u30b1\\u30fc\\u30b7\\u30e7\\u30f3\\u60c5\\u5831\\u3092\\u62fe\\u3063\\u3066\\u307f\\u308b Mechanize\\u3067\\u7c21\\u5358\\u306b\\u5b9f\\u88c5\\u3067\\u304d\\u305f\\u306e\\u3067\\u7d39\\u4ecb\\u3002 \\u4ee5\\u4e0b\\u306e\\u30bd\\u30fc\\u30b9\\u3092 test.rb\\u306a\\u3069\\u3068\\u3057\\u3066\\u4fdd\\u5b58\\u3057\\u3001\\u30b3\\u30de\\u30f3\\u30c9\\u30e9\\u30a4\\u30f3\\u5f15\\u6570\\u306bIP\\u30a2\\u30c9\\u30ec\\u30b9\\u3092\\u4e0e\\u3048\\u3066\\u5b9f\\u884c\\u3059\\u308b\\u3068\\u3001\\u30ed\\u30b1\\u30fc\\u30b7\\u30e7\\u30f3\\u60c5\\u5831\\u3092\\u51fa\\u529b\\u3059\\u308b\\u3002\",\"inLanguage\":\"en-GB\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?p=362#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?author=1#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?author=1#author\"},\"image\":{\"@type\":\"ImageObject\",\"url\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/wp-content\\\/uploads\\\/2014\\\/02\\\/\\u7bc4\\u56f2\\u3092\\u9078\\u629e_002.png\",\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?p=362\\\/#mainImage\",\"width\":760,\"height\":344},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/?p=362#mainImage\"},\"datePublished\":\"2014-02-22T01:17:15+09:00\",\"dateModified\":\"2014-03-21T17:20:19+09:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/#website\",\"url\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/\",\"name\":\"Love Linux\",\"description\":\"enjoy using linux for programming flatform\",\"inLanguage\":\"en-GB\",\"publisher\":{\"@id\":\"https:\\\/\\\/lovelinux.mydns.jp\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b","description":"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b Mechanize\u3067\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u305f\u306e\u3067\u7d39\u4ecb\u3002 \u4ee5\u4e0b\u306e\u30bd\u30fc\u30b9\u3092 test.rb\u306a\u3069\u3068\u3057\u3066\u4fdd\u5b58\u3057\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u5f15\u6570\u306bIP\u30a2\u30c9\u30ec\u30b9\u3092\u4e0e\u3048\u3066\u5b9f\u884c\u3059\u308b\u3068\u3001\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u51fa\u529b\u3059\u308b\u3002","canonical_url":"https:\/\/lovelinux.mydns.jp\/?p=362","robots":"max-image-preview:large","keywords":"","webmasterTools":{"google-site-verification":"fo5n0bjUdcitu1FsBTJqqwL580wBLhhCM51IEogDt9Y","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/lovelinux.mydns.jp\/?p=362#article","name":"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b","headline":"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b","author":{"@id":"https:\/\/lovelinux.mydns.jp\/?author=1#author"},"publisher":{"@id":"https:\/\/lovelinux.mydns.jp\/#person"},"image":{"@type":"ImageObject","url":"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/02\/\u7bc4\u56f2\u3092\u9078\u629e_002.png","width":760,"height":344},"datePublished":"2014-02-22T01:17:15+09:00","dateModified":"2014-03-21T17:20:19+09:00","inLanguage":"en-GB","mainEntityOfPage":{"@id":"https:\/\/lovelinux.mydns.jp\/?p=362#webpage"},"isPartOf":{"@id":"https:\/\/lovelinux.mydns.jp\/?p=362#webpage"},"articleSection":"rails, \u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0, ruby"},{"@type":"BreadcrumbList","@id":"https:\/\/lovelinux.mydns.jp\/?p=362#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/lovelinux.mydns.jp#listItem","position":1,"name":"Home","item":"https:\/\/lovelinux.mydns.jp","nextItem":{"@type":"ListItem","@id":"https:\/\/lovelinux.mydns.jp\/?cat=2#listItem","name":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0"}},{"@type":"ListItem","@id":"https:\/\/lovelinux.mydns.jp\/?cat=2#listItem","position":2,"name":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0","item":"https:\/\/lovelinux.mydns.jp\/?cat=2","nextItem":{"@type":"ListItem","@id":"https:\/\/lovelinux.mydns.jp\/?cat=6#listItem","name":"rails"},"previousItem":{"@type":"ListItem","@id":"https:\/\/lovelinux.mydns.jp#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/lovelinux.mydns.jp\/?cat=6#listItem","position":3,"name":"rails","item":"https:\/\/lovelinux.mydns.jp\/?cat=6","nextItem":{"@type":"ListItem","@id":"https:\/\/lovelinux.mydns.jp\/?p=362#listItem","name":"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b"},"previousItem":{"@type":"ListItem","@id":"https:\/\/lovelinux.mydns.jp\/?cat=2#listItem","name":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0"}},{"@type":"ListItem","@id":"https:\/\/lovelinux.mydns.jp\/?p=362#listItem","position":4,"name":"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b","previousItem":{"@type":"ListItem","@id":"https:\/\/lovelinux.mydns.jp\/?cat=6#listItem","name":"rails"}}]},{"@type":"Person","@id":"https:\/\/lovelinux.mydns.jp\/?author=1#author","url":"https:\/\/lovelinux.mydns.jp\/?author=1","name":"hiroshi","image":{"@type":"ImageObject","@id":"https:\/\/lovelinux.mydns.jp\/?p=362#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/e7c5ca03ae8cd5b5d36ac0f62f59c26d34fd667afa57dafb4978790c04c5146f?s=96&d=mm&r=g","width":96,"height":96,"caption":"hiroshi"}},{"@type":"WebPage","@id":"https:\/\/lovelinux.mydns.jp\/?p=362#webpage","url":"https:\/\/lovelinux.mydns.jp\/?p=362","name":"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b","description":"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b Mechanize\u3067\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u305f\u306e\u3067\u7d39\u4ecb\u3002 \u4ee5\u4e0b\u306e\u30bd\u30fc\u30b9\u3092 test.rb\u306a\u3069\u3068\u3057\u3066\u4fdd\u5b58\u3057\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u5f15\u6570\u306bIP\u30a2\u30c9\u30ec\u30b9\u3092\u4e0e\u3048\u3066\u5b9f\u884c\u3059\u308b\u3068\u3001\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u51fa\u529b\u3059\u308b\u3002","inLanguage":"en-GB","isPartOf":{"@id":"https:\/\/lovelinux.mydns.jp\/#website"},"breadcrumb":{"@id":"https:\/\/lovelinux.mydns.jp\/?p=362#breadcrumblist"},"author":{"@id":"https:\/\/lovelinux.mydns.jp\/?author=1#author"},"creator":{"@id":"https:\/\/lovelinux.mydns.jp\/?author=1#author"},"image":{"@type":"ImageObject","url":"https:\/\/lovelinux.mydns.jp\/wp-content\/uploads\/2014\/02\/\u7bc4\u56f2\u3092\u9078\u629e_002.png","@id":"https:\/\/lovelinux.mydns.jp\/?p=362\/#mainImage","width":760,"height":344},"primaryImageOfPage":{"@id":"https:\/\/lovelinux.mydns.jp\/?p=362#mainImage"},"datePublished":"2014-02-22T01:17:15+09:00","dateModified":"2014-03-21T17:20:19+09:00"},{"@type":"WebSite","@id":"https:\/\/lovelinux.mydns.jp\/#website","url":"https:\/\/lovelinux.mydns.jp\/","name":"Love Linux","description":"enjoy using linux for programming flatform","inLanguage":"en-GB","publisher":{"@id":"https:\/\/lovelinux.mydns.jp\/#person"}}]},"og:locale":"en_GB","og:site_name":"Love Linux | enjoy using linux for programming flatform","og:type":"article","og:title":"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b","og:description":"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b Mechanize\u3067\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u305f\u306e\u3067\u7d39\u4ecb\u3002 \u4ee5\u4e0b\u306e\u30bd\u30fc\u30b9\u3092 test.rb\u306a\u3069\u3068\u3057\u3066\u4fdd\u5b58\u3057\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u5f15\u6570\u306bIP\u30a2\u30c9\u30ec\u30b9\u3092\u4e0e\u3048\u3066\u5b9f\u884c\u3059\u308b\u3068\u3001\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u51fa\u529b\u3059\u308b\u3002","og:url":"https:\/\/lovelinux.mydns.jp\/?p=362","article:published_time":"2014-02-21T16:17:15+00:00","article:modified_time":"2014-03-21T08:20:19+00:00","twitter:card":"summary_large_image","twitter:title":"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b","twitter:description":"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b Mechanize\u3067\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u305f\u306e\u3067\u7d39\u4ecb\u3002 \u4ee5\u4e0b\u306e\u30bd\u30fc\u30b9\u3092 test.rb\u306a\u3069\u3068\u3057\u3066\u4fdd\u5b58\u3057\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u5f15\u6570\u306bIP\u30a2\u30c9\u30ec\u30b9\u3092\u4e0e\u3048\u3066\u5b9f\u884c\u3059\u308b\u3068\u3001\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u51fa\u529b\u3059\u308b\u3002"},"aioseo_meta_data":{"post_id":"362","title":"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b","description":"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b\r\nMechanize\u3067\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u305f\u306e\u3067\u7d39\u4ecb\u3002\r\n\r\n\u4ee5\u4e0b\u306e\u30bd\u30fc\u30b9\u3092 test.rb\u306a\u3069\u3068\u3057\u3066\u4fdd\u5b58\u3057\u3001\u30b3\u30de\u30f3\u30c9\u30e9\u30a4\u30f3\u5f15\u6570\u306bIP\u30a2\u30c9\u30ec\u30b9\u3092\u4e0e\u3048\u3066\u5b9f\u884c\u3059\u308b\u3068\u3001\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u51fa\u529b\u3059\u308b\u3002","keywords":[{"label":"IP","value":"IP"},{"label":"\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831","value":"\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831"},{"label":"ruby","value":"ruby"}],"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2025-08-25 10:59:29","updated":"2025-08-25 10:59:29","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/lovelinux.mydns.jp\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/lovelinux.mydns.jp\/?cat=2\" title=\"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\">\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/lovelinux.mydns.jp\/?cat=6\" title=\"rails\">rails<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tRuby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/lovelinux.mydns.jp"},{"label":"\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0","link":"https:\/\/lovelinux.mydns.jp\/?cat=2"},{"label":"rails","link":"https:\/\/lovelinux.mydns.jp\/?cat=6"},{"label":"Ruby \u3067 IP\u30a2\u30c9\u30ec\u30b9\u304b\u3089\u30ed\u30b1\u30fc\u30b7\u30e7\u30f3\u60c5\u5831\u3092\u62fe\u3063\u3066\u307f\u308b","link":"https:\/\/lovelinux.mydns.jp\/?p=362"}],"_links":{"self":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/362","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=362"}],"version-history":[{"count":4,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/362\/revisions"}],"predecessor-version":[{"id":592,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/posts\/362\/revisions\/592"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=\/wp\/v2\/media\/416"}],"wp:attachment":[{"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lovelinux.mydns.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}