Skip to Content.
Sympa Menu

discuss - Re: [opennic-discuss] The website

discuss AT lists.opennicproject.org

Subject: Discuss mailing list

List archive

Re: [opennic-discuss] The website


Chronological Thread 
  • From: Peter Green <peter AT greenpete.free>
  • To: discuss AT lists.opennicproject.org
  • Subject: Re: [opennic-discuss] The website
  • Date: Fri, 07 Dec 2012 01:53:24 +0000

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Great, thanks for that Brian, I'll add that tomorrow all being well.

Peter

Brian Koontz <brian AT opennicproject.org> wrote:

>On Thu, Dec 06, 2012 at 09:47:37PM +0000, Peter Green wrote:
>> I would like to incorporate the 'nearest nameserver' feature into the
>> demo site, the box top right of the home page on the wiki. Would the
>> code for this be available anywhere? I have had a look around but
>> can't see it. I'm guessing this code is the work of Brian or Jeff
>maybe.
>
>You can't see it because it's an action on the wiki. Here's the
>pertinent code:
>
> $ch = curl_init();
>curl_setopt($ch, CURLOPT_URL,
>"http://sourpuss.net/opennic.oss/geoip/geotxt3.php?ip=$ip".$res);
> ob_start();
> curl_exec($ch);
> $res = ob_get_contents();
> curl_close($ch);
> ob_end_clean();
> $results = array_filter(preg_split("/\s+/ ", $res));
>
> $brk = '';
> if($noformat == 0)
> {
> print "<br/>\n";
>print "Closest Tier 2 servers to your location (ordered from nearest to
>farthest):<br/>\n";
> $brk = "<br/>";
> }
>
> foreach($results as $server)
> {
> print $server.$brk."\n";
> }
>
> --Brian

- --
Wanged from my Kaiser by a mischievous pixie!
-----BEGIN PGP SIGNATURE-----
Version: APG v1.0.8

iQFBBAEBCAArBQJQwUwUJBxQZXRlciBHcmVlbiA8cGV0ZXJAZ3JlZW5wZXRlLmNv
LnVrPgAKCRDwSqngs+9nOW8JCACaTBTYyt7k7+FLwr9siUz7EX7z+HB/uSuG73go
UAPBcJ66pGSItcX1DrIJKsaj9pLvxRORnwL9etp5+LlO0E270pYP12cQlkyJ6sQM
9QAN9ybN3lNQmXl7WjFuhId1sXOnFoX0ZFAgI1rNXhn9IMFTaCTz6oGJF2ojdURB
Av2phSjpThmnQZ9E78f1bHwcQLaNaAwyuzSmUpSv35VPQ93r2QoLXvmfW0zryryU
RDK5i/X8KPq6TEhL1v0cYc+nuABd87pGlLjaWZuaUn6cu7ejMvh+gvpqcD0yBiSC
fMRtSLcglgBGC0fIR0DkJ7poYKiGSlkTRFKuOlD1tvwlheaR
=E192
-----END PGP SIGNATURE-----




Archive powered by MHonArc 2.6.19.

Top of Page