Fronteers 2009 Of Hamsters, Feature Creatures and Missed Opportunities

Post on 06-May-2015

3.464 views 0 download

description

My presentation at Fronteers 2009 about the opportunity we have as developers to liberate ourselves from the fail that is browsers and write some nice code to mix data on the web.

Transcript of Fronteers 2009 Of Hamsters, Feature Creatures and Missed Opportunities

Of hamsters, feature creatures and missed opportunities

Chris&anHeilmann,Fronteers,Amsterdam,5thofNovember2009(remember,remember)

Hamstering.

STUPID

Howwelearntwebdesignisnottherightway.

WaSP Interact

h@p://interact.webstandards.org/

Opera Web Standards curriculum

h@p://www.opera.com/company/educa&on/curriculum/

Ourjob:evolvingtheweb

Specialists.

Fanboys.

*bleep*

Libraries.

(...)

Writeless,domore.!=

Writeless,makeithardtomaintain.

Bewarethefeaturecreature.

Thefeatureloop

Complex

Simple

Feedback

Features

Shi[ingourpointofviewtospotopportuni&es.

Ourtechnologiesareshithot.

Thewebisnotsites.

Thewebisnotcode.

Itisaboutdata.

h@p://www.flickr.com/photos/22414102@N07/3508671863/

Buildingwithcomponents.

http://www.flickr.com/photos/seven13avenue/2080281038/

CMS

KobayashiMaru

PhotosfromFlickr?

select*fromflickr.photos.searchwheretext="cat"

HeadlinesoftheNewYorkTimes?

select*fromnyt.ar&cle.searchwherequery="spontaneouscombus&on"

LatestcommitsonaGitHubrepo?

select*fromgithub.repo.commitswhereid='yql'andrepo='yql‐tables'

LatestheadlinesoftheVolkskrant?

select&tlefromhtmlwhereurl="h@p://www.volkskrant.nl/"andxpath="//h2[@&tle]"

LatestEnglishheadlinesoftheVolkskrant?select*fromgoogle.translatewhereqin(select&tlefromhtmlwhereurl="h@p://www.volkskrant.nl/"andxpath="//h2[@&tle]")andtarget='en'

Upda&ngTwi@er?

use'h@p://www.yqlblog.net/samples/twi@er.status.xml';insertintotwi@er.status(status,username,password)values("Inyourfronteers,blowingurmindz","codepo8","didyoureallythinkIshowit?")

Upda&ngWordpress?

insertintowordpress.post(&tle,descrip&on,blogurl,username,password)values("TestTitle","Thisisatestbody","h@p://ajaxian.com","cheilmann","iedoesitright")

Upda&ngtheinternet?

deletefrominternetwhereuser_agent="MSIE"andversion<8;

Notye

t,soz.

SearchoneterminGoogle,BingandYahoo?

select*fromquery.mul&wherequeries='select*frommicroso[.bingwherequery="JimmyHoffa"andsourcein("web");select*fromgoogle.searchwhereq="JimmyHoffa";select*fromsearch.webwherequery="JimmyHoffa"'

Orthemanlyway...

h@ps://query.yahooapis.com/v1/public/yql?q={uri‐encoded‐query}&format={xml|json}&diagnos&cs={true|false}&callback={func&on}&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys

Youcanmixandmatchwhateveryouwant.Youcansortandlimit.Youcanextendwithyourowndatatablesbywri&ngaschemaandpu|ngitonGitHub.Youcanstoreinforma&onontheYQLservers(thecloud,thecloud)

Where’sthecatch?

10khitsanhour(20kwithoAuth).100khitsaday.Dataiscachedfor15minutes(sooncustomisable).Execu&onlimitontheserveris30seconds(fornow).

That’s

all!

Let’sbiteintoanexample.

FindAmsterdam.

select*fromgeo.placeswheretext="amsterdam"

DefineAmsterdamandgetphotostakenthere.

select*fromflickr.photos.searchwherewoe_idin(selectwoeidfromgeo.placeswheretext="amsterdam")

Getalltheinforma&onaboutthesephotos.

select*fromflickr.photos.inforwherephoto_idin(selectidfromflickr.photos.searchwherewoe_idin(selectwoeidfromgeo.placeswheretext="amsterdam"))

Getonlywhatweneed.

selectfarm,id,secret,owner.realname,server,&tle,urls.url.contentfromflickr.photos.infowherephoto_idfromflickr.photos.inforwherephoto_idin(selectidfromflickr.photos.searchwherewoe_idin(selectwoeidfromgeo.placeswheretext="amsterdam"))

SelectformatJSON,defineacallbackandcopyandpastetheURL.h@ps://query.yahooapis.com/v1/yql?q=select%20*%20from%20flickr.photos.info%20where%20photo_id%20in%20(select%20id%20from%20flickr.photos.search%20where%20woe_id%20in%20(select%20woeid%20from%20geo.places%20where%20text%3D%22amsterdam%22))&format=json&diagnos&cs=false&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=flickr

CopyintoascriptsrcandwriteafewlinesofDomScrip&ng.

PROFIT!

h@p://isithackday.com/hacks/ajaxexperience/flickrgeophotos.html

Toolazytochangethedemo,meh.

Also:FAIL.

DonottrustJavaScripttobeavailable!

SomoveyourJavaScriptserverside!

YQLopentablescanhaveembeddedJSthatrunsontheYQLserver(withRhino)andsupportsXMLna&velywithE4X.

DisplaywithJavaScript:

DisplaywithPHP:

Joinus!h@p://github.com/yql/yql‐tables

RTFMh@p://developer.yahoo.com/yql/

Spendyour&meonmakingthewebfunforhumans,notpleasingmachines.

Ifyouareclever,youareallowedtobelazy.

Replacingthewebwouldbetough,souseitwell.

Chris&anHeilmannh@p://wait‐&ll‐i.comh@p://developer‐evangelism.comh@p://twi@er.com/codepo8

Bedankt!