Building With YQL And YUI

Post on 20-Jan-2015

6.428 views 3 download

Tags:

description

An introductory talk how to build quick mashups and products by using YQL to get information of the Web and YUI to build the interface. By building on top of proven concepts and systems that are in use in large web sites and applications you have the time to concentrate on what you want to achieve with your application rather than making it work for browsers.

Transcript of Building With YQL And YUI

YQLandYUIBuildingblocksforquickapplica8ons

Chris8anHeilmann,Yahoointernaltalk,Sunnyvale,California,02/02/2010

Iamknowntobeabletoquicklybuildcooldemos.

hIp://icant.co.uk/goohoobi/index.php?research

ThereasonisthatIambuildingwiththingsthatwork.

Andthatgivesme8metoconcentrateontheimportantthings.

OnethingIamboredofiswri8ngCSSlayouts.

WhichiswhyIamusingaverysimplesolu8on.

ThereasonisthatIwanttosupportbrowsers‐notworkforthem.

I’dratherbeabletoupdateaCSSURIthanre‐writemyCSSwhenanewbrowsercomesaround.

Thingswespendfartoomuch8meon:

Hackstomakebrowserswork.Op8misingprematurely.Usingourpetlanguage/environment/libraryReadingbadlywriIentutorialsandincompletedocumenta8on.Usingbleedingedgeeffectsandinterfacesandthentryingtocreateafallbacksolu8on.Flashyeffects.

Whatwereallyshouldstartwithisthedata.

ThisiswhereAPIsandwebservicescomein.

TheissueisthatallofthesearewriIendifferently,expectdifferentauthen8ca8onandgivebackdifferentdata.

YQLhIp://developer.yahoo.com/yql/console/

select{what}from{where}where{condi8ons}

Afewexamples...

select*fromflickr.photos.searchwheretext="donkey"

Afewexamples...

select*fromflickr.photos.searchwheretext="donkey"andlicense=4

Afewexamples...

select*fromcraigslist.searchwhereloca8on="s`ay"andtype="sss"andquery="flowerpot"

Afewexamples...

select*fromgoogle.newswhereq="healthcare"

Afewexamples...select*fromquery.mul8wherequeriesin('select*fromnyt.ar8cle.searchwherequery="healthcare"','select*frommicrosoc.bing.newswherequery="healthcare"','select*fromgoogle.newswhereq="healthcare"'

)

Afewexamples...

selectcontentfromhtmlwhereurl="hIp://www.foxnews.com/"andxpath="//h2/a"

Afewexamples...

select*fromgoogle.translatewhereqin(selectcontentfromhtmlwhereurl="hIp://www.foxnews.com/"andxpath="//h2/a"

)andtarget="fr"

Afewexamples...

insertintowordpress.post(8tle,descrip8on,blogurl,username,password)values("TestTitle","Thisisatestbody","hIp://yqltest.wordpress.com","yqltest","password")

UsingYQLhasalotofbenefits:

No8mewastedreadingAPIdocsUsingtheconsolemakescrea8ngcomplexqueriesdeadeasy.Datafilteringdowntotheleastamountnecessary.Fastpipes.Caching+conver8ngServer‐sideJavaScript

UsingYQLiseasy!(PHP)

UsingYQLiseasy!(JavaScript)

WhatItendtodowithYQLisbuildAPIsthatrenderoutHTML.

Thereason:re‐use.

An“API”likethisallowsyoutobuildanon‐scriptversionandre‐useitwithAjaxforaslickerexperience.

Furthermore,youcanofferittotheoutsideworldlater:)

Andtobuildtheinterface,Iuselibraries.

Libraries.

(...)

STOPTH

EMADN

ESS

Buildinterfacesthatwork!

Byusingout‐of‐the‐boxsolu8onsandkeepingapragma8cmindyoucanquicklybuildsomething.

Andifthatisnotcrea8veenoughforyou,youcouldhelpimprovingthelibrariesthatenableotherstodoso.

Onlybyusing,tes8ngandimprovingwecanbuildbeIersolu8ons.

So,givethethingsIshowedago,andfeedbacktouswhatneedsimprovement!

Chris8anHeilmannhIp://wait‐8ll‐i.comhIp://developer‐evangelism.comhIp://twiIer.com/codepo8

Thanks!