# Re: IP to Country (#139)

**URL:** <https://www.ruby-forum.com/t/re-ip-to-country-139/114650>\
**Category:** Ruby\
**Created:** [September 17, 2007, 1:23pm UTC](https://www.ruby-forum.com/t/re-ip-to-country-139/114650 "2007-09-17T13:23:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![steve\_d](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ce73a5/32.png) [@steve\_d](https://www.ruby-forum.com/u/steve_d)\
**Post date:** [September 17, 2007, 1:23pm UTC](https://www.ruby-forum.com/t/re-ip-to-country-139/114650/1 "2007-09-17T13:23:38Z")

</div>

From: “Simon Kröger” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> Ok, my script does not need any initialization, it uses the file  
> IpToCountry.csv exactly as downloaded.

Same here.

$ time ruby locate.rb 1.2.3.4 4.5.6.77 128.129.130.131 255.255.255.255  
no country  
US  
US  
ZZ

real 0m0.287s

time for 300 random IPs is:

real 0m1.187s
