local lom = require 'lxp.lom' local xpath = require 'xpath' local response = http.request { -- 12798885 is the "WOEID" for Bellevue, WA url = 'https://query.yahooapis.com/v1/public/yql', params = { q = 'select * from weather.forecast where woeid=12798885' } } local condition = xpath.selectNodes(lom.parse(response.content), '//yweather:condition')[1] return string.format( 'Bellevue, WA has the condition "%s" and is %d degrees Farenheit.', condition.attr.