Mintoris Forum

Author Topic: getting local outdoor temperature  (Read 2570 times)

Charlie

  • Sr. Member
  • ****
  • Posts: 117
getting local outdoor temperature
« on: Apr 04, 2015, 10:10 PM »
This snippet uses www.wunderground.com to get the outdoor temperature from a given weather station. Use a browser to localize it for your neighborhood by going to www.wunderground.com and finding a local station.  Then used its URL replace the one in the snippet. Trim off the excess verbiage as needed, to just get the temperature numbers.

Charlie

  • Sr. Member
  • ****
  • Posts: 117
Re: getting local outdoor temperature
« Reply #1 on: Apr 07, 2015, 02:02 PM »
By going to www.wundergound.com, without further specification, one gets a report that includes the temperature for the nearest few locations, in a different format. The version previously given requires specification of a known weather station and the line found looks like

"temperature": 52.7,

when in the non-specified mode one has to look for a line like:

<span class="wx-value">55.6</span>

Several of them appear, for different stations in your neighborhood.  The attached version of the program looks for the first such line and trims off the excess verbiage. In my case the first one found is not the closest, but it's still in the ballpark.

Charlie

  • Sr. Member
  • ****
  • Posts: 117
Re: getting local outdoor temperature
« Reply #2 on: Mar 04, 2016, 06:28 PM »
This no longer works.  Wunderground now redirects to a page that says "There is nothing to see here. Please move along…"

Charlie

  • Sr. Member
  • ****
  • Posts: 117
Re: getting local outdoor temperature
« Reply #3 on: Mar 05, 2016, 03:00 AM »
The attached goes to a different site to get local temperature for a given zip code (see the pands= parameter).

Charlie

  • Sr. Member
  • ****
  • Posts: 117
Re: getting local outdoor temperature
« Reply #4 on: Mar 07, 2016, 03:44 PM »
The original version (using Weather Underground) seems to be working again.