[ 2 posts ]

Itye Richter

  • Username: itye
  • Joined: Wed Apr 28, 2010 11:56 am
  • Posts: 2
  • GitHub: itye
  • Gists: itye
  • IRC: itye
  • Offline
  • Profile
Tags:

JSONP and Yahoo! Pipes

Post Posted: Wed Apr 28, 2010 12:06 pm
+0-
Hi,
Thank you for this module, it is very useful.

I am trying to access a Yahoo! Pipe via JSONP, however the callback parameter is _callback=something. Notice the "_" before the callback.
How can I change the default call of JSONP module, which is using callback=something, to the one that Pipes requires?
Here is the code that I use:

Code:
YUI({
            modules: {
                'gallery-jsonp': {
                    fullpath: 'http://yui.yahooapis.com/gallery-2010.02.10-01/build/gallery-jsonp/gallery-jsonp-min.js',
                    requires: ['get', 'oop'],
                    optional: [],
                    supersedes: []
                }

            }
        }).use('gallery-jsonp', 'node', function(Y) {
            rss = 'http://www.engadget.com/rss.xml';
            var url = 'http://pipes.yahoo.com/pipes/pipe.run?_id=gH84AH3M2xGUtbMFdbq02Q&_render=json&rssUrl=' + encodeURIComponent(rss) + '&callback={callback}';
            Y.jsonp(url, function(jsonObj) {
                Console.log(jsonObj);
            });
        });


Thanks!
Itye.

Itye Richter

  • Username: itye
  • Joined: Wed Apr 28, 2010 11:56 am
  • Posts: 2
  • GitHub: itye
  • Gists: itye
  • IRC: itye
  • Offline
  • Profile

Re: JSONP and Yahoo! Pipes

Post Posted: Wed Apr 28, 2010 12:52 pm
+0-
I figured it out.
I used :
Code:
Y.JSONPRequest._template = "_callback={callback}";


to override the original template.

Thanks again!
Itye.
  [ 2 posts ]
Display posts from previous:  Sort by  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum