IP locator

IP locator

Postby Marc Vanzegbroeck » Sat Jul 08, 2006 8:44 am

Does anyone has already creates a program tha locates the location of a IP-adress. I have created a program that extract the time,date,url, refer URL and IP-adress of the visitors on a website from a log-report provided by the host of the site.
There are some websites where you can enter a IP-adress, and returns the location (Country, state,city) of that IP adress.
I want to call a site that gives this information and automaticly add it in the database. Does anyone knows such a site. All the sites I found show the result on there site, but how can I extract it, so I can import the data?
Ik know there are some sites that give this information for free if you add a little script on the pages of your site. But it would be nice if I can make it myself, so I can use that info.

Thanks,
Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Postby Antonio Linares » Mon Jul 10, 2006 7:47 am

Marc,

You may use whois.sc/<IP> from the explorer or similar.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42149
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Marc Vanzegbroeck » Mon Jul 10, 2006 9:43 am

Thanks Antonio,

I already found some free database on the net which are updated each month. The have the IP info and locations of that IP. I even found one wich holding the city info but it's a .dat-file than only can be read with API-function you have to call from you program.

This is a example for C, but hou can I implement this?
Code: Select all  Expand view  RUN
#include <GeoIP.h>
int main (int argc, char *argv[]) {
  GeoIP * gi;
  gi = GeoIP_new(GEOIP_STANDARD);
  printf("code %s\n",
    GeoIP_country_code_by_name(gi, "yahoo.com"));
}



Regards,
Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Postby Antonio Linares » Mon Jul 10, 2006 11:54 am

Marc,

For Harbour and FWH:
Code: Select all  Expand view  RUN
function Main()

   MsgInfo( Country_Code( "yahoo.com" ) )

return nil

#pragma BEGINDUMP

#include <hbapi.h>
#include <GeoIP.h>

HB_FUNC( COUNTRY_CODE )
{
  GeoIP * gi = GeoIP_new( GEOIP_STANDARD );

  hb_retc( GeoIP_country_code_by_name( gi, hb_parc( 1 ) ) );
}

#pragma ENDDUMP
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42149
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Marc Vanzegbroeck » Mon Jul 10, 2006 12:03 pm

Thanks Antonio,

I think I should move from FW to FWH so I can take advantage of the 32bit language 8)

When will be the next FWH release, so I have the latest version?

Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium

Postby Antonio Linares » Fri Jul 14, 2006 10:30 am

Marc,

We recently published it: FWH 2.7 build June 2006.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42149
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby RAMESHBABU » Sat Jul 22, 2006 2:56 am

Hi Marc,

Have you succeeded in your reqrement ?

If so, can you share the function with me too!.

Thanks and regards

- Ramesh Babu P
User avatar
RAMESHBABU
 
Posts: 626
Joined: Fri Oct 21, 2005 5:54 am
Location: Secunderabad (T.S), India

Postby Marc Vanzegbroeck » Sat Jul 22, 2006 11:50 am

Ramesh,

Since I still use FW and no FWH, I can't use the function yet (I'am gona move soon to xHarbour). Till thenI use the database that is updated each week. This is a csv-file. I export this file to a DBF-file and use the normal clipper-functions to locate the IP and country info.

Regards,
Marc
Marc Vanzegbroeck
 
Posts: 1159
Joined: Mon Oct 17, 2005 5:41 am
Location: Belgium


Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 4 guests