Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
ASk HN: A json - jsonp proxy service
11 points by retube on May 31, 2010 | hide | past | favorite | 15 comments
Hi All,

I've run up against the cross-site ajax issue of not being able to request a json from another domain. Sadly this domain does not offer a jsonp alternative.

Of course I can write/host my own proxy, but 1) I was wondering whether there are any proxy services already available (Yahoo yql?) or 2) if not, whether it would be worth setting one up for public use?

Feedback/thoughts appreciated!



http://jsonpify.com/ is probably ideal for you.... The API is like http://jsonpify.com/api?url=XXX&format=xml&jsonp=myc...

but you can also do this with http://pipes.yahoo.com/pipes/ and http://developer.yahoo.com/yql/console/ . Both are excellent and used often for this exact purpose.


I've used YQL via the Console and works a charm unless the site prohibits it in its robots.txt (like Google Image Search) http://developer.yahoo.com/yql/console


Yes looks like exactly what I'm looking for - super simple. I note he also mentions YQL, which might be the way to go for higher-use apps


Does the other domain have a CORS policy? If so:

http://ajaxian.com/archives/cor-blimey-cross-domain-ajax-is-...


No idea. Thanks for the link, I'll investigate.


It should be noted that as far as I know, CORS only works with FF 3.5+, Safari 4+, Chrome (4+?), IE8+ and current versions of Mobile Safari. You'll still need a JSON(p) proxy for others, but if CORS is supported by the server, it's worth using just for the speed gain & bandwidth savings.


Check out GDATA (from Google) and YQL (from Yahoo). Actually, here's a tutorial that goes into using jQuery and YQL: http://ajaxian.com/archives/using-yql-as-a-proxy-for-cross-d...


ok great thanks. I'll try and hack it to avoid using jQuery though, not a huge fan of using libs if only utilising a single feature/function


I set up exactly this thing yesterday with Yahoo Pipes. But they're having problems these days (apparently since December): lots of connection refused errors and others. Some bloggers "broke up" with the service and others were more blunt.


do you pay for this? Are there caps on usage or restrictions on application types you can use it for?



Cool, thanks. Just thinking, but is there not a way in javascript to just get the contents of a URI as a string? Which you could then eval? Presumably this will be possible with WebSockets?


I think Yahoo pipes does what you need: http://pipes.yahoo.com


ok, interesting. I know nothing about pipes, so will look it that. Thanks.


Pipes is a wonderful thing, you can do a lot with it (like consume Google Analytics emails with it to be able to make public charts by scraping the analytics XML attachments and surfacing them as public JSON: http://blogoscoped.com/archive/2008-01-17-n73.html ).

The only problem with pipes is that if you're building anything that you will depend on (rather than it being a "nice to have") then your service now wholly depends on Yahoo maintaining pipes.

The question I always fall back to is, "Do I want my service to be wholly dependent on a third party if I can avoid it?". As you can avoid it, I'd choose to write my own proxy in this instance.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: