It is currently July 20th, 2019, 6:11 am

JSBarometer

Post your work-in-progress and completed skins to share and discuss.
User avatar
jsmorley
Developer
Posts: 19295
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

JSBarometer

jsmorley » February 16th, 2019, 5:47 pm

Updated and improved an old skin I had that used to use Yahoo Weather as the source. Now uses WXData / Weather.com.

Shows you the current barometric pressure in inches / Hg (US, Imperial) or millibars / mb (Metric), with some guidance about what the pressure, combined with the state of change, means for your short-term weather forecast.

Properly read, a barometer is all you really need to know what is likely to happen for the next couple of hours.

JSBarometer_Feb 17, 2019.rmskin


1.jpg

Code: Select all

	if tonumber(currentPressure) <= 28.59 then
		if string.find(currentChange, 'falling') then
			currentDescription = 'Increasingly Stormy'
		elseif string.find(currentChange, 'steady') then
			currentDescription = 'Remaining Stormy'
		elseif string.find(currentChange, 'rising') then
			currentDescription = 'Stormy, but Improving'
		end
	end
		
	if tonumber(currentPressure) >= 28.6 and tonumber(currentPressure) <= 29.50 then
		if string.find(currentChange, 'falling') then
			currentDescription = 'Rain Forecasted'
		elseif string.find(currentChange, 'steady') then
			currentDescription = 'Remaining Rainy'
		elseif string.find(currentChange, 'rising') then
			currentDescription = 'Rainy, but Improving'
		end
	end
	
	if tonumber(currentPressure) >= 29.51 and tonumber(currentPressure) <= 30.09 then
		if string.find(currentChange, 'falling') then
			currentDescription = 'Changing toward Rain'
		elseif string.find(currentChange, 'steady') then
			currentDescription = 'Change Possible'
		elseif string.find(currentChange, 'rising') then
			currentDescription = 'Changing toward Fair'
		end
	end
	
	if tonumber(currentPressure) >= 30.1 and tonumber(currentPressure) <= 30.5 then
		if string.find(currentChange, 'falling') then
			currentDescription = 'Fair, but Degrading'
		elseif string.find(currentChange, 'steady') then
			currentDescription = 'Remaining Fair'
		elseif string.find(currentChange, 'rising') then
			currentDescription = 'Fair, and Improving'
		end
	end
	
	if tonumber(currentPressure) >= 30.6 then
		if string.find(currentChange, 'falling') then
			currentDescription = 'Very Dry, but Degrading'
		elseif string.find(currentChange, 'steady') then
			currentDescription = 'Remaining Very Dry'
		elseif string.find(currentChange, 'rising') then
			currentDescription = 'Increasingly Very Dry'
		end		
	end

Note that WXData only updates more or less once an hour, so if you live in Kansas, and you are watching the skies and keeping one eye on the door to the storm cellar, it's best not to depend on this, but turn the crank on that portable radio and listen to that. When you head down, don't forget your little dog too...
You do not have the required permissions to view the files attached to this post.
User avatar
Smurth
Posts: 5
Joined: February 2nd, 2019, 2:10 pm

Re: JSBarometer

Smurth » February 17th, 2019, 11:29 am

Nice ;)
User avatar
jsmorley
Developer
Posts: 19295
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: JSBarometer

jsmorley » February 17th, 2019, 5:42 pm

Changed some cosmetics to add arrows indicating direction and rate of change. New version in first post.