seasonfood.coffee 731 B

1234567891011121314151617
  1. # Show BBC seasonal food list.
  2. window.cbfunc = (data) ->
  3. list = data.query.results.results.result
  4. names = ['January', 'February', 'March',
  5. 'April', 'May', 'June',
  6. 'July', 'August', 'September',
  7. 'October', 'November', 'December']
  8. for item in list
  9. console.log [item.name.replace(/\s/ig, ' '), ':',
  10. names[item.atItsBestUntil], 'to',
  11. names[item.atItsBestFrom]].join(' ')
  12. phantom.exit()
  13. el = document.createElement 'script'
  14. 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'
  15. document.body.appendChild el