Lasso Soft Inc. > Home


AuthorJason Huck
Posted08 May 2006
Updated08 May 2006
More by this author...


Returns a 7-day forecast for the given zip code using the WeatherBug API. The result is an array of maps containing a prediction, expected high and low temperatures, etc. for each day. Requires a valid WeatherBug API key.

Sample Usage

var('forecast') = weatherbug_getfullforecast(

iterate($forecast, local('s'));
	iterate(#s->keys, local('i'));
		#i + ': ' + #s->find(#i) + '
\n'; /iterate; '
\n' * 2; /iterate;

Source Code

Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.

	-description='Returns a 7-day forecast for the given zip code.'
	local('url' = 'http://' + #key + '');
	local('getparams') = array(
		'acode' = #key,
		'zipcode' = #zip
	local('response') = include_url(
	#response->replace(' xmlns:aws=""','')&replace('aws:','');
	local('xmldata') = xml(#response);
	local('forecasts') = #xmldata->extract('//forecast');
	local('out' = array);
	local('fields') = array(
	iterate(#forecasts, local('s'));
		#s = xml('' + #s);
		local('map' = map);
		iterate(#fields, local('f'));
			local('v') = #s->extract('//' + #f + '/text()')->first;
			#map->insert(#f = #v);

Related Tags


No comments

Please log in to comment

Subscribe to the LassoTalk mail list

LassoSoft Inc. > Home



©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft