GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Free geo-ip for your website (test this) (https://gfy.com/showthread.php?t=671437)

SmokeyTheBear 10-28-2006 10:46 PM

Free geo-ip for your website (test this)
 
I often see people asking for an easy free solution so here goes
p.s. because its free its not perfect but it also is alot less tasking on your server than most free methods

exampe usage of below code
http://ytmnd.webspacemania.com/freegeo/
Code:



<html>
<head>
</head>
<body>


Hi, I'm Brooke i live in






<?php
// ip to html by stb
$addr = getenv("REMOTE_ADDR");
$url = "http://api.hostip.info/get_html.php?ip=$addr&position=true";
$html = file_get_contents($url);
$trip = explode('Latitude:',$html);
$ctcn = $trip[0];
$trip = explode('City: ',$ctcn);
$ctcn = trim($trip[1]);
echo $ctcn;
?>


 and i'm super horny



</body>
</html>


Damian_Maxcash 10-28-2006 11:00 PM

Quote:

Originally Posted by SmokeyTheBear (Post 11179642)
I often see people asking for an easy free solution so here goes
p.s. because its free its not perfect but it also is alot less tasking on your server than most free methods

exampe usage of below code

Hey - its better than the one in your sig! :)

but I did go to the site and update the record for my IP :winkwink:

Everyone should do that - it might make it worth using on bigger projects.

If it doesn't get yours right click here www.hostip.info and you can change it for them.

martinsc 10-28-2006 11:03 PM

Quote:

Hi, I'm Brooke i live in (Unknown city) and i'm super horny
i guess it has some issues with israel....

Sly 10-28-2006 11:05 PM

Apparently it doesn't know San Diego either.

Damian_Maxcash 10-28-2006 11:07 PM

Quote:

Originally Posted by Sly (Post 11179723)
Apparently it doesn't know San Diego either.

Did you go and change it for them?

woj 10-28-2006 11:09 PM

doesn't work for me either :-/
"Hi, I'm Brooke i live in (Unknown City?) and i'm super horny"

soulbleed 10-28-2006 11:13 PM

didnt work for me

Sly 10-28-2006 11:14 PM

I fixed it. Must need a lot of work.

SmokeyTheBear 10-28-2006 11:16 PM

Quote:

Originally Posted by damian2001 (Post 11179705)
Hey - its better than the one in your sig! :)

but I did go to the site and update the record for my IP :winkwink:

Everyone should do that - it might make it worth using on bigger projects.

If it doesn't get yours right click here www.hostip.info and you can change it for them.

:thumbsup

everyone should go to www.hostip.info and add their city to the list , its a user built databse

SmokeyTheBear 10-28-2006 11:20 PM

its also got a cool plugin for firefox to show the city location of any link

like this
http://www.hostip.info/images/firefox_scrnshot.gif

Bro Media - BANNED FOR LIFE 10-28-2006 11:24 PM

nice job smokey, ill put it to use :)

Evil1 10-29-2006 12:29 AM

New Castle, DE?? 301.68 miles off!

phasic 10-29-2006 01:52 AM

Thanks smokey, answered my ? directly. Although its extremely faulty. How many people got it right on the first visit with out correcting? I guess if its the only free method thats my only choice though, eh?

Yngwie 10-29-2006 03:05 AM

Quote:

Originally Posted by woj (Post 11179749)
doesn't work for me either :-/
"Hi, I'm Brooke i live in (Unknown City?) and i'm super horny"


didn't work for me, but I went to http://www.hostip.info/index.html and added my city to their list and now it works.

heywood 10-29-2006 03:16 AM

Quote:

Originally Posted by phasic (Post 11180728)
Thanks smokey, answered my ? directly. Although its extremely faulty. How many people got it right on the first visit with out correcting? I guess if its the only free method thats my only choice though, eh?

Most of the GeoIP stuff out there is less than accurate. I think this is something that will certainly take time to iron out. ISPs pop up switch around so much these days, it seems like it would be a nightmarish database to maintain.

Thanks for the info smokey, I've worked on a couple solutions myself, but yours seems the easiest. I worked with the free version of GeoIPmax and the database version is horrible (took me forever to figure out a good index, and even then it was slow) and the binary version is decent. But I think the one smokey posted above the simplest for our end.

BTW Smokey, would you be willing to verify some code (my zango removal tool (link to thread)) and post the results?

pornpf69 10-29-2006 06:40 AM

I have their "script" and their free DB on my server

SmokeyTheBear 10-29-2006 07:53 AM

Quote:

Originally Posted by phasic (Post 11180728)
Thanks smokey, answered my ? directly. Although its extremely faulty. How many people got it right on the first visit with out correcting? I guess if its the only free method thats my only choice though, eh?

theres a few other free services available , they require a bit more work though , i figured i would post the "easy smeazie" way..

The thing with most geo-ip services is the database is a few mb's so everytime someone hits your script your server has to look thru the db file.. this method is less taxing on your server

borked 10-29-2006 09:25 AM

Quote:

Originally Posted by SmokeyTheBear (Post 11182219)
The thing with most geo-ip services is the database is a few mb's so everytime someone hits your script your server has to look thru the db file.. this method is less taxing on your server

Not really - I'm using geoip perl and benchmarking apache with 500k hits on the perl script (lookup on a 25MB city binary database binary) didn't really tax the server at all....

if people like, I'll open it up to all - it's geolite, so it's not 100%.

Hey, if enough people are willing to subscribe at, say $1/10k lookups, I'll get the main, pretty darn accurate maxmind city database...

Basic_man 10-29-2006 09:34 AM

(Unknow City) ... that's farrrrrrrrrr from here :P

jesse_adultdatingdollars 10-29-2006 09:43 AM

Works for me in San Diego :)

interracialtoons 10-29-2006 10:18 AM

Works for me!

quantum-x 10-29-2006 10:44 AM

Or even easier:

PHP Code:

preg_match_all('`^[^:]+: (.+)$`misU',file_get_contents('http://api.hostip.info/get_html.php?ip='.$SERVER['REMOTE_ADDR'].'&position=true'),$matches);

echo 
$matches[1][0]."<br />";
echo 
$matches[1][1]."<br />";; 

Outputs
Quote:

AUSTRALIA (AU)
Brisbane
One line solutions rock.

borked 10-29-2006 02:51 PM

if people are not getting accurate results from hostip.info, the following should be better:

http://geo.corecoder.com/

to test your own ip, or

http://geo.corecoder.com/?ip=xx.xx.xx.xx

to test a specific one.

If you want all data, not just the city, it can be found here:

http://geo.corecoder.com/full?ip=xx.xx.xx.xx

SmokeyTheBear 10-29-2006 03:03 PM

Quote:

Originally Posted by quantum-x (Post 11182909)
Or even easier:

PHP Code:

preg_match_all('`^[^:]+: (.+)$`misU',file_get_contents('http://api.hostip.info/get_html.php?ip='.$SERVER['REMOTE_ADDR'].'&position=true'),$matches);

echo 
$matches[1][0]."<br />";
echo 
$matches[1][1]."<br />";; 

Outputs


One line solutions rock.

much better and simpler.. i bow to the power of proper php :)

starpimps 10-30-2006 01:25 AM

it got me in canada but wrong city


All times are GMT -7. The time now is 12:26 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123