Live data from Hacker News

Your IP. In JSON

jsonip.com

41–50 of 72 posts

Re: Your IP. In JSON

#42

Great idea by the way! I don't know what for... yet... but great idea! For some reason I have a strange urge to combine this with http://openkeyval.org/

Openkeyval is kind of cool except that it uses Memcache as the storage platform--i.e. no guarantees of persistance.

Re: Your IP. In JSON

#44

Some suggestions: Make jsonip.com dual stack IPv4/IPv6 and work for IPv6 addresses too. Return some other useful IP information, such as the PTR, the domain name part of the PTR, and the country code and name. Example: https://grepular.com/ipinfo EDIT: Don't use that URL for your own stuff or I'll block it. I only put it there as an example of how the JSON should be returned. EDIT2: Might be useful if it included the…

IPv6 is silly to support. There are no IPv6 NATs, so you should know your IPv6 address.

Re: Your IP. In JSON

#45
post #13
post #3

Earlier quoted context omitted.

its there already: http://jsonip.com/nameofcallbackfunction

You should probably include the ?callback= functionality anyway. A great deal of libraries assume it will be a get variable, and cater for it specially i.e. jQuery with http://jsonip.com/?callback= ?

your absolutely right, but I did not make jsonip.com

If you are using a framework for this, most of the time you are able to override callback function name, i.e. jQuery uses jsonpCallback : http://api.jquery.com/jQuery.ajax/

If not, load it manually as a script and generate a function for the callback.

Re: Your IP. In JSON

#46
post #34

Some suggestions: Make jsonip.com dual stack IPv4/IPv6 and work for IPv6 addresses too. Return some other useful IP information, such as the PTR, the domain name part of the PTR, and the country code and name. Example: https://grepular.com/ipinfo EDIT: Don't use that URL for your own stuff or I'll block it. I only put it there as an example of how the JSON should be returned. EDIT2: Might be useful if it included the…

This brings up something I'm waffling on. Whats the correct content type for JSON? in your example returning "Content-Type: text/plain; charset=UTF-8" which is nice because FF knows to render it in the browser (good for debugging atleast). But votes on SO seem to indicate it should be "application/json" http://stackoverflow.com/questions/477816/the-right-json-con...

Use application/json plus the JSONView Firefox plugin to get nice pretty printed json output.

Re: Your IP. In JSON

#48

Some suggestions: Make jsonip.com dual stack IPv4/IPv6 and work for IPv6 addresses too. Return some other useful IP information, such as the PTR, the domain name part of the PTR, and the country code and name. Example: https://grepular.com/ipinfo EDIT: Don't use that URL for your own stuff or I'll block it. I only put it there as an example of how the JSON should be returned. EDIT2: Might be useful if it included the…

IPv6 is silly to support. There are no IPv6 NATs, so you should know your IPv6 address.

There are two scenarios where such a site has been useful to me:

1) Making sure I deprecated the right addresses in the Linux kernel, and that the kernel was using the outgoing address I wanted instead of the one it would pick via RFC 3484, and

2) Making sure IPv6 browsing is working since turning off v4 is a pain in the ass (in the setups I've had to troubleshoot v6 on, not my home network, where it's much easier).

Post reply on HN