https://github.com/max-mapper/jsonpify
turn json apis into jsonp apis through a heroku proxy!
https://github.com/max-mapper/jsonpify
Last synced: 12 months ago
JSON representation
turn json apis into jsonp apis through a heroku proxy!
- Host: GitHub
- URL: https://github.com/max-mapper/jsonpify
- Owner: max-mapper
- Created: 2010-09-15T02:24:09.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2012-06-04T20:31:21.000Z (almost 14 years ago)
- Last Synced: 2025-01-07T14:44:41.934Z (over 1 year ago)
- Language: Ruby
- Homepage: jsonpify.heroku.com
- Size: 109 KB
- Stars: 16
- Watchers: 4
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.textile
Awesome Lists containing this project
- awesome - max-mapper/jsonpify - turn json apis into jsonp apis through a heroku proxy! (<a name="Ruby"></a>Ruby)
README
h1. JSONP-ifier!!!!!
h2. Turns any JSON API into a JSONP API through the magic of proxying
So you are trying to AJAX some JSON, right? And you run into the single origin policy? And the JSON API that you're hitting hasn't implemented JSONP? Dang! Here's an example of what you might do:
bc. $.getJSON("http://api.plancast.com/02/plans/show.json?plan_id=34ck", function(data) { doStuffWith(data)});
But instead of precious data, you would receive nasty CSRF error!
Fret not, young internet warrior! You can wrap that little puppy in a JSONPify URL for maximum JSONPification!
bc. $.ajax({
url: "http://jsonpify.heroku.com?resource=http://api.plancast.com/02/plans/show.json",
data: {
plan_id: '34ck'
}
dataType: 'jsonp',
success: function(data){
// manipulate data
}
});
h2. Installation
Clone this repository, then run:
bc. $ rackup
Then, open http://localhost:9292/.