I'd like to create a client for last.fm. My music "station" feed is here, in JSON format: http://www.last.fm/player/station/user/skeftomai/mix.
However, when I try to access this via $.getJSON()
, I get
No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://my.exampledomain.com' is therefore not allowed access.
So unfortunately we have a CORS issue on last.fm's end. I'd like to work around this. Here are some things I've tried:
- AJAX. This fails with the Access-Control-Allow-Origin error.
- An iframe with document.domain set to "www.last.fm" or "last.fm". This fails with SAMEORIGIN iframe error.
- JSONP. Unfortunately JSONP doesn't seem to be supported with this feed.
- A
<script>
tag with src pointing to the feed link. Unfortunately$('#scriptTagId').html()
is empty. - Flash. But unfortunately suffers from the same cross-origin issue.
- Java applet. Too heavy, everyone might not have the JVM installed, and it might suffer from the same cross-origin issue.
I'm fairly sure I could get away with a web proxy whereby the client utilizes a server-size proxy to retrieve the feed...but I really, really want this to be a pure client-side app with no server-side. I'd like to host this on a CDN (S3 + Cloudfront).
Is there ANY way around this?