eval( '(' + YahooWebServices + ')' );
Our friend Jeff McManus over at the Yahoo! Developer Network clued us in to Y! Web Services now being available in a delicious new flavor: JSON--JavaScript Object Notation. Say bye-bye to XML parsing and the need for (very much) intermediary code when building Web 2.0 or single-page applications using Y!'s services and data. Simply fetch a wodge of JSON representing serialized results from Yahoo!'s servers, eval()
(pronounced "evaluate") to turn it back into a JavaScript object, and your application is dealing with ordinary JavaScript objects. And even if you're not writing your code in JavaScript, there's most likely a JSON parser for your programming language of choice, allowing you to skip all the XML bits and get on with your application.
PS: Now that widgets can access personal user data such as Yahoo photo albums, calendars and address books it is possible for any developer to look at our new widgets and figure out how to tap into that data as well. However, please note that the calendar/address book/etc APIs that we’re using in these new widgets are not officially supported through the Yahoo Developer Network, so proceed at your own risk (or wait for the official APIs to come out).Yahoo!—particularly their Yahoo! Developer Network, continues to open things up with abandon to third-party Web app developers willing to give the emerging Yahoo! platform a whirl.
tags: nitty gritty tech
| comments: 7
| Sphere It
submit:
0 TrackBacks
TrackBack URL for this entry: http://blogs.oreilly.com/cgi-bin/mt/mt-t.cgi/4443
Comments: 7
Pure and simple are often not quite the same thing with the latter leading to interesting apps while the former still fiddles about with Hello, World. While the JSON will suit those writing one-page apps down to the ground, it's also a really nice way design from the outside in, going pure if and when needed.
(Hey Jeff, don't forget about that TCL browser plugin ;-)
Hi
I was wondering if you could help me out in finding a tool or a way in which i can compare and find out the diffrences between two different schemas.I have an schema defined in the external system and the xml generated from it leads to an a smaller xml which has an diffrent schema defined in my C# .net code.Manually comparing them is a cumbersome process as well as prone to errors also.
Any Suggestions please do mail me or post them here.
Thanx
loginotavailable
"I can't tell you how useful a bootstrap it is to deal directly with data in a way your programming language understands"...which I guess is why the Lisp people like their language so much :)
I like JSON a lot, but I have to say, the idea of throwing freshly-downloaded data directly into an eval(), without any parsing or validation, gives me the willies security-wise...
You don't need to (and I'd never want to) run the code straight through an eval. There is an open source parser available at http://www.crockford.com/JSON/js.html which covers your back and keeps you safe from running arbitrary code. There are a lot of good resources there for other languages as well, although I've only had experience with the JavaScript code.
Post A Comment:
STAY CONNECTED
RECENT COMMENTS
- Justin Mason on eval( '(' + YahooWebServices + ')' );: Chris -- perfect! than...
- Chris Fairbanks on eval( '(' + YahooWebServices + ')' );: You don't need to (and ...
- Justin Mason on eval( '(' + YahooWebServices + ')' );: I like JSON a lot, but ...
- dennis on eval( '(' + YahooWebServices + ')' );: "I can't tell you how u...
- ravi on eval( '(' + YahooWebServices + ')' );: Hi I was wondering if ...
- Rael Dornfest on eval( '(' + YahooWebServices + ')' );: Pure and simple are oft...
- Jeffrey McManus on eval( '(' + YahooWebServices + ')' );: The purists will hopefu...
Jeffrey McManus [12.15.05 05:20 PM]
The purists will hopefully be OK with what we're doing since we're still providing the ability to go after the raw XML data if you want. This is just an accelerator that makes sense because in the browser, only one language matters -- Javascript.