Skip to content

Instantly share code, notes, and snippets.

@thinkphp
Created June 2, 2010 11:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thinkphp/422243 to your computer and use it in GitHub Desktop.
Save thinkphp/422243 to your computer and use it in GitHub Desktop.
Request.Flickr = new Class({
Extends: Request.JSONP,
options: {
url: "http://query.yahooapis.com/v1/public/yql?q=use%20'http%3A%2F%2Fthinkphp.ro%2Fapps%2FYQL%2FgetFlickrBy%2520YQLExecute%2Fflickrlist.xml'%20as%20flickr%3B%20%0A%0ASELECT%20*%20%0A%0AFROM%20flickr%20%0A%0AWHERE%20text%3D'{text}'%20AND%20location%3D'{location}'%20AND%20amount%3D{amount}%0A",
data: {
format: 'xml'
}
},
initialize: function(params,options) {
this.parent(options);
this.options.url = this.options.url.substitute(params);
}
});
window.addEvent('domready',function(){
new Request.Flickr({text: 'beach',location: 'turkey',amount: 20},{
onSuccess: function(o){
$('flickrlist').set('html',o.results);
}
}).send();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment