Rails Support

Support on setups where you copy the hostip.info database locally.

Moderator: Moderators

Rails Support

Postby swehner on Sat Apr 29, 2006 1:38 pm

The code for a rudimentary first attempt to get at the data under Rails is posted at

http://sugarmotor.net:8080

To see it in action go to

http://sugarmotor.net:8080/places/ip

I don't know how to deal with the %20 and %2C strings that are contained in the database fields. For example:

Parker%2C%20CO Colorado.

I don't know why they are there. Could someone explain the purpose before I get to this?

Also I found the PHP code offered for download by svn incomplete. I don't know why that would be so. For example, I could not see how to set the database, username, password etc.


Stephan
swehner
n00b
 
Posts: 2
Joined: Sat Apr 29, 2006 1:33 pm

Postby robocoder on Mon May 01, 2006 8:25 am

In the current cities database, %2C and %20 are hex ASCII codes for the comma and space (respectively) between a US city and its state. You can probably change this to ", " without ill effect.

As for the purpose of having %2C and %20, legitimate reasons include:
  • pre-encoding for safe use in URLs
  • Exporting to a CSV file.
User avatar
robocoder
Veteran
 
Posts: 105
Joined: Sat Mar 25, 2006 8:10 pm
Location: Ontario, Canada

Postby swehner on Mon May 01, 2006 9:15 am

Yes, I noticed that after a while. The code is updated accordingly, and still available at http://sugarmotor.net:8080
swehner
n00b
 
Posts: 2
Joined: Sat Apr 29, 2006 1:33 pm


Return to Hostip.info database local copy support

Who is online

Users browsing this forum: No registered users and 0 guests

cron