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: nanashiRei <nanashi.rei AT gmail.com>
  • To: discuss AT lists.opennicproject.org
  • Subject: Re: [opennic-discuss] The website
  • Date: Thu, 13 Dec 2012 02:03:43 +0100
  • Organization: YaS-Online



Am 13.12.2012 00:50, schrieb Alex Nordlund:
> Can't we make the data sane instead?

For the love of god:
It's web related? Use JSON, thank you.

Here a little example:

Request:
http://api.opennic.free/api/find-dns.json?by=location&countries=de,nl,fr&location=gps_cords_here

Reply:
{ "result": "success",
"dns": {
"servers": [
"123.123.123.123",
"45.67.89.10"
]
},
"timestamp": 123456789
}

With php you can digest this like this:
$apiResponse = json_parse($httpResponse);

And read values from it like:
echo $apiResponse->dns->servers[0];
//or
foreach($apiResponse->dns->servers as $dnsServer) {
echo $dnsServer;
}

If that's not easy and (in)sane, then i don't know :P

Keywords: RESTful, JSON, Caching, Controller, Routing

I may offer my help on this in i have plenty of experience with RESTful
APIs and JSON handling. Also i'm JS Ninja.

--
David "nanashiRei" Marner
Founder of YaS-Online.net
Service from Gamers, for Gamers.

PGP public key @ http://nanashirei.me/pgp
Commercial contact: nanashi.rei AT senshi.jp

Attachment: signature.asc
Description: OpenPGP digital signature




Archive powered by MHonArc 2.6.19.

Top of Page