Battle 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.
Not fun with JS:
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.
select * from
search.termextract where
context in (
select abstract from
search.web(100) where
query="warsaw"
)
| sort(field="Result")
| unique(field="Result")
if(('localStorage' in window) &&
window['localStorage'] !== null){
var what = JSON.parse(
localStorage.getItem('cake')
);
// what -> Object{...}
// and not [Object object]
}
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.