YQL is an amazing tool to use and offer APIs to the world. As you can do the lot in JavaScript it is pretty simple to get started. There is however also the option that you do things wrong and make your end users and yourself unhappy. This talk works around some of the issues you might face.
29. A simple plan:
1. Investigate Twitter’s search API and
Google’s translation API and if
needed, get keys.
2. Get the results from Twitter for a
certain search.
3. Loop over the results, see which ones
are not in English, and then translate
them with the Google Translation
API.
32. 1. Asynchronous lookups with
generated script nodes are a pain to
get right - what if one breaks?
2. Depending on how many Tweets are
not in English, you have to hammer
Google’s translation API which slows
down your overall app.
33. YUI fixes a few of
those issues.
1. Using JSONP you can have success
and failure events.
2. You can also provide timeouts
IO
JSON
JSON-P
JSON-P
YQL-Query
GET
45. select * from csv where url="http://
spreadsheets.google.com/pub?
key=tpWDkIZMZleQaREf493v1Jw&output=
csv" and
columns="Year,City,Sport,Discipline,Country
,Event, Gender,Type" and Year="1924"
56. select * from html where
url="http://www.slideshare.net/
cheilmann/reasons-to-be-cheerful-
fronteers-2010"
and
xpath="//ol/li/p[contains(.,'http')]"
79. if(('localStorage' in window) &&
window['localStorage'] !== null){
localStorage.setItem(
'cake',
'much better than cookies'
)
}
80. if(('localStorage' in window) &&
window['localStorage'] !== null){
var what = localStorage.getItem(
'cake'
)
// what -> 'much better than
cookies'
}
83. if(('localStorage' in window) &&
window['localStorage'] !== null){
var what = JSON.parse(
localStorage.getItem('cake')
);
// what -> Object{...}
// and not [Object object]
}
113. In summary
Use YQL instead of wasting time
reading API docs for a simple task
Filter data in the service and get the
info back in formats you need.
Use the fast YQL server instead of
doing lots of requests.
Write your own JS APIs using
execute.
Use local storage and don’t break
caching.
Go and use the web.
Go easy on effects.