![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
![]() A few threads have recently come up (again) about geolocation ( geoip ), so I thought I'd give a few pointers and an example of how easy it is.
First off, maxmind's geoip database is probably the best option as it's free. However, it requires installation, which isn't easy and if you want to query specific IP addresses, you can't use the apache module. So you end up using the PHP or Perl modules, which are *really* frikken slow. So, for those not wanting to go that route, geoplugin.com has a webservice that uses Maxmind's data (the free database for the webservice as maxmind refuse to allow their paid database for direct external IP lookups). This webservice is a bit better than simply using the maxmind geoip db as it also returns data on nearby places to a location and a currency converter. To use geoplugin, there's a really easy to use PHP class, that even the brain-dead person can add to their pages. Someone recently asked about GeoIP adverts for their dating site. If anyone wants the script that displays the image below (you can choose your own images, but these ones are public domain and royalty-free images), just give me a shout and I'll send it on. An example geo-localised advert displaying your city (as seen by maxmind's geoip db) and places around you. ![]() [/PublicServiceAnnouncement]
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
And if I find anyone hotlinking that gif, I'll come and cut your nuts off, cos I said I'd give you the script for free, ya lazy bandwidth-hogging freeloaders
![]()
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Join Date: Feb 2001
Location: Puerto Del Carmen, Lanzarote, Canary Islands
Posts: 1,572
|
Great for me, its only 1500 KM off position.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Too lazy to set a custom title
Join Date: Mar 2002
Location: Australia
Posts: 17,393
|
Never seen geo dating ads do surrounding areas, which seems like something obvious... guess someone has to think of it first! :D How do you determine the surrounding cities, is that part of the maxmind db too?
(I don't recognise any of the names in your sample because my geo IP loc pretty much always shows me in another state) |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
what is it saying? I think I have image caching on
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
Confirmed User
Join Date: Feb 2001
Location: Puerto Del Carmen, Lanzarote, Canary Islands
Posts: 1,572
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 | |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
Quote:
$theta = $lon1 - $lon2; $dist = sin(deg2rad($lat1)) * sin(deg2rad($lat2)) + cos(deg2rad($lat1)) * cos(deg2rad($lat2)) * cos(deg2rad($theta)); $dist = acos($dist); $dist = rad2deg($dist); $miles = $dist * 60 * 1.1515; $unit = strtoupper($unit); Surrounding areas can be turned off in that add image: Nearby ON: ![]() ![]()
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Industry Role:
Join Date: Apr 2006
Location: Germany
Posts: 4,323
|
Running your php code on my server?
I don't think so... no thanks.
__________________
--- ICQ 14-76-98 <-- I don't use this at all |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 | |
Too lazy to set a custom title
Join Date: Mar 2002
Location: Australia
Posts: 17,393
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
What is the point of that comment? The code is all open so you can check yourself that nothing is untoward.
Jeese, some people are so damn suspicious. Would it make you feel better if I charged you $100 for it ![]()
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 | |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
Quote:
![]() There are online lookups, like terraserver.net (free), and Microsoft's Mapthingy (paid) that can be used. I just fancied a home-grown one and so went the *very* long route. see http://www.geoplugin.com/webservices/extras I was going to open it up to allow for radius changes, but the cpu spikes if some tit puts in a massive radius, so I left it at default 10miles.
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Join Date: Feb 2001
Location: Puerto Del Carmen, Lanzarote, Canary Islands
Posts: 1,572
|
borked
Why are you offering a service thats using your server for free ? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
because there are lots of things I do which aren't for commercial gain.
This particular venture was because when I was doing something that used geo stuff a long long time ago, I was frustrated as hell as to how difficult it was to do. So I set this up to help others. No ulterior motives at all. People that use it are programmers, and that's what it's all about.
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Confirmed User
Join Date: May 2005
Posts: 2,737
|
You can also use the Net_GeoIP package + Cache_Lite from PEAR. That's what I use and cache per IP. If anyone wants to know how to use that, hit me up. My results thus far have been very accurate using the free Maxmind DB.
Good post regardless Borked. Why aren't you ever on icq/aim anymore? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
Too lazy to set a custom title
Industry Role:
Join Date: Jul 2001
Location: Currently Incognito
Posts: 13,827
|
Or you can just download the free db and the scripts they provide, upload it behind the web and ask your host to set that dir as global. Now just echo out the geoip call to anything, page, script, picture, with a single line.
__________________
![]() ![]() ![]() It's all disambiguation ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
whadya mean? Course I'm on!
BTW, do some benchmarking with Net_GeoIP compared to a C wrapper or the apache module - net_geoip is dog slow.... When you compile the maxmind source, look in the examples folder - there's a cool shell script in there. Modify it a bit to take into account the new values, like continent code and some other new things, then have php call that script and parse the output. Far far faster for querying specific IP addresses. Bit overkill to gain a few msecs, but thought I'd throw it out there. I needed to go that route, as I'm doing a shit load of lookups per day, so the diff between 1usec and 10msecs is huge.
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
You didn't read the OP did you tut tut.
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 |
Confirmed User
Join Date: Feb 2001
Location: Puerto Del Carmen, Lanzarote, Canary Islands
Posts: 1,572
|
borked
Thanks for the inspiring post, your php class has given me some new ideas for our flight info, weather and exchange rate feeds. I will probably end up using a paid for geo service but for now your class is a great experimental tool. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#19 |
Too lazy to set a custom title
Industry Role:
Join Date: Jul 2001
Location: Currently Incognito
Posts: 13,827
|
__________________
![]() ![]() ![]() It's all disambiguation ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#20 | |
Confirmed User
Join Date: May 2005
Posts: 2,737
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#21 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
original post
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#22 | |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
Quote:
Just cos it's free, doesn't mean it's crap though ![]() If you need any help with your project, give me a shout
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#23 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
Dopy, just so you know (which isn't documented anywhere), queries are limited to a rate of 60/minute, which has never caused any probs amongst those that use it. If you hammer away at a faster rate than that, you'll get blacklisted for 1hr.
I had to implement that, cos it was being abused.
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#24 |
Too lazy to set a custom title
Industry Role:
Join Date: Jul 2001
Location: Currently Incognito
Posts: 13,827
|
Ah, I did read the Original Post.. It's a nice thing to have access to the City DB at no charge, don't get me wrong.
But if someone can download and setup this up then setting up and using what maxmind provides for free isn't going to trip the person up. Personally, I purchase the City DB, some hosts provide it free. Anyway, Konrad took the base Maxmind scripts, made a couple quick adjustments and all was set. Over the last several years we have shared the setup with lots of people. No host, program or Webmaster has ever came back saying it was slow. Not saying what you have won't work like a champ, I'm sure it will.. But the real basic setup and use of GEOIP is easier than setting up a Web Form.
__________________
![]() ![]() ![]() It's all disambiguation ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#25 | |
Confirmed User
Join Date: Feb 2001
Location: Puerto Del Carmen, Lanzarote, Canary Islands
Posts: 1,572
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#26 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
Doc -
Yeah, fair enough. Was just showing that the class outputs the "Nearby" stuff and the inbuilt currency converter, things that aren't simple at all to do and certainly imposs with maxmind. The thread wasn't meant as a sales pitch at all, but was just making the point that it can be real easy, since there have been a few posts recently that have shown that it is quite difficult for some (and some don't even have dedi boxes to install the stuff on)
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#27 | |
Too lazy to set a custom title
Industry Role:
Join Date: Jul 2001
Location: Currently Incognito
Posts: 13,827
|
Quote:
![]()
__________________
![]() ![]() ![]() It's all disambiguation ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#28 |
Confirmed User
Industry Role:
Join Date: Dec 2006
Location: Amsterdam
Posts: 1,119
|
it says Nijmegen (NL), while it should be Dronten (NL)
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#29 |
Guest
Posts: n/a
|
same here is says either Den Haag or Ypenburg both in NL, not even close, considering the Netherlands is a small country but both are at least 50KM or more off.
|
![]() ![]() ![]() ![]() ![]() |
![]() |
#30 |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
You guys are missing the point - geolocation by IP at the city level is never going to be 100% accurate, and especially so for small countries. If your in a small country, the ISP is going to be less likely to group IPs by city and simply assign an entire block to a very large region.
Accuracy wasn't the point of the thread ![]()
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#31 | |
Confirmed User
Join Date: Dec 2004
Location: Back in Blighty
Posts: 4,277
|
Quote:
![]() Both the banner and underlying site automatically appear in one of 45 languages ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#32 | |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
Quote:
![]() Language-localised ads are a must imo. Geo-localising anything is pointless if you aren't displaying the text in the user's preferred language.
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#33 | |
Confirmed User
Join Date: Dec 2004
Location: Back in Blighty
Posts: 4,277
|
Quote:
![]() ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#34 |
making it rain
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 22,018
|
Man it pisses me off when people quote the distance that your geo targeting is off, as if that has anything to do with anything. All that proves is ignorance on how the technology works.
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#35 |
ICQ: 197-556-237
Join Date: Jun 2003
Location: BRASIL !!!
Posts: 57,559
|
Usefull...! thanks.
__________________
I'm just a newbie. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#36 |
Too lazy to set a koala
Industry Role:
Join Date: Jan 2007
Location: CZ/EU forever!
Posts: 16,139
|
hmm cool man this is the most accurate geo i saw ... everytime it was at least 50km, now you are 5 km from my location, great keep up the good work!
![]()
__________________
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#37 |
Confirmed User
Industry Role:
Join Date: Jan 2002
Location: Los Angeles
Posts: 1,414
|
Awesome service Andy! Been using this for some time and love it..
__________________
Email [email protected] | Skype: jjslimm |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#38 |
Confirmed User
Join Date: Sep 2008
Location: Toronto
Posts: 118
|
![]() Great information in this thread!
Thanks borked |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#39 |
Confirmed User
Join Date: Jun 2007
Location: UK
Posts: 397
|
Top work borked, will defo be trying this out
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#40 | ||
Confirmed User
Industry Role:
Join Date: Apr 2006
Location: Germany
Posts: 4,323
|
Quote:
Quote:
If you wanted to help programmers, you would release the full code, both on the client and server side. ![]()
__________________
--- ICQ 14-76-98 <-- I don't use this at all |
||
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#41 | |
Confirmed User
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
|
Quote:
If you don't agree with his principles or methodology, don't use the service. Noone is forcing you ![]() |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#42 |
Confirmed User
Industry Role:
Join Date: Apr 2006
Location: Germany
Posts: 4,323
|
Of course I won't use his service.
![]()
__________________
--- ICQ 14-76-98 <-- I don't use this at all |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#43 | |
Totally Borked
Industry Role:
Join Date: Feb 2005
Posts: 6,284
|
Quote:
I couldn't give a toss if you use it or not tbh, but there is zero financial gain or incentive in this operation, whether you believe it or not ![]()
__________________
![]() For coding work - hit me up on andy // borkedcoder // com (consider figuring out the email as test #1) All models are wrong, but some are useful. George E.P. Box. p202 |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#44 |
Confirmed User
Join Date: Feb 2002
Location: ICQ: 251425 Fr/Au/Ca
Posts: 6,863
|
..and? Do you want a medal or something?
|
![]() |
![]() ![]() ![]() ![]() ![]() |