LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Script to get City Lat - Log, City Name, Country, etc. (https://www.linuxquestions.org/questions/programming-9/script-to-get-city-lat-log-city-name-country-etc-379273/)

latino 11-02-2005 09:44 AM

Script to get City Lat - Log, City Name, Country, etc.
 
Hi:

I need a cript that could pass a IP list through:
http://www.geobytes.com/IpLocator.htm?GetLocation

and get some data like:

Lat - Lon
City
Country
Population

The most important are: Lat, Log, City and Country.

The question is, IF this is possible to make such a script that could pass the IPs and grab those variables???

TIa

:study: :rolleyes:

fvgestel 11-02-2005 10:18 AM

try something like this :

#!/bin/bash
while read LINE
do
wget http://www.geobytes.com/IpLocator.ht...ion&ipaddress=$LINE | <grep out the variables>
done

this will read IP-adresses from STDIN, one per line

Greets, Frank

latino 11-02-2005 10:24 AM

Hi fvgestel:

Thanks. I am not a programmer altough I have used some bash scirpts before, could you be a little more specific? I have doubt regarding the INPUT and the OUTPUT part.

What is STDIN?

TIA

:)

fvgestel 11-02-2005 10:32 AM

STDIN is standard input. Could be your terminal, could be a file with IP-adresses. eg :

cat <filename> | yourscript.sh

If you run the script without the cat command and pipe, the script will wait for you to type in IP-adresses from the terminal

Greets, Frank

latino 11-02-2005 08:50 PM

Hmmm:

No luck here, any other reco or an alternative maybe using Lynx with the script?? After researching, I found that quesrys are limited at 20 per hour. So the script have to follow this restriction....

Thanks

:(

fvgestel 11-03-2005 04:49 AM

Yes, you could also use lynx, using the -dump option
so : lynx -dump http://www.geobytes.com/IpLocator.ht...ion&ipaddress=$LINE


All times are GMT -5. The time now is 08:05 AM.