CNETAPI.js, ObjectBrowser.js
Hey gang,
Two new classes in the CNET libraries today.
CNETAPI.js
The first, CNETAPI, is probably not going to be very interesting to those of you reading this who don't work at CNET. Basically, this class makes it super-duper easy to get stuff out of our REST API. For example:
//this is my dev key; get your own!
new CNETAPI(19926949750937665684988687810562);
//now our request:
new CNETAPI.TechProduct(32069546).chain(function(){
dbug.log("got the Ipod, here's the data: ", this.data);
alert(this.data.Name + ": " + this.data.EditorsRating.$);
});
//this is my dev key; get your own!
new CNETAPI(19926949750937665684988687810562);
//now our request:
new CNETAPI.TechProduct(32069546).chain(function(){
dbug.log("got the Ipod, here's the data: ", this.data);
alert(this.data.Name + ": " + this.data.EditorsRating.$);
});

Pretty snazzy, eh? Props go to Hunter Brown who wrote the guts of this class. I (Aaron) added some flare. More details and examples in the wikitorial.
ObjectBrowser.js
I'm working on some CMS tools for selecting options out of a tree (think genres/ontology) and I needed a tree browser. So I wrote a generic one that can be used to explore just about any kind of javascript object. Rather than paste in a lot of detail here, I'll just point you towards the wikitorial.

Leave a Reply