Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / phantomjs / lib / phantom / examples / seasonfood.coffee
1 # Show BBC seasonal food list.
2
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']
9   for item in list
10     console.log [item.name.replace(/\s/ig, ' '), ':',
11                 names[item.atItsBestUntil], 'to',
12                 names[item.atItsBestFrom]].join(' ')
13   phantom.exit()
14
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