1 # Show BBC seasonal food list.
3 window.cbfunc = (data) ->
4 list = data.query.results.results.result
5 names = ['January', 'February', 'March',
6 'April', 'May', 'June',
7 'July', 'August', 'September',
8 'October', 'November', 'December']
10 console.log [item.name.replace(/\s/ig, ' '), ':',
11 names[item.atItsBestUntil], 'to',
12 names[item.atItsBestFrom]].join(' ')
15 el = document.createElement 'script'
16 el.src = 'http://query.yahooapis.com/v1/public/yql?q=SELECT%20*%20FROM%20bbc.goodfood.seasonal%3B&format=json&diagnostics=true&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=window.cbfunc'
17 document.body.appendChild el