Script to grep the pollen count from wunderground.
Whatever was going on, I had to really kludge the scraping of the value form the webpage.
Anyway, here it is, seems to work.
Copy the .txt file to your script folder. Delete the _v1.1.txt extension, as this IS a .vb file.
You will need to create an event that runs a script:
dwr_pollen.vb("Main","ZipCode")
Main, is just main. Zipcode, you will need to change that to your zipcode.
I did this, as I was considering adding in a second "location", so this way, you can setup multiple locations. Maybe I'll follow Jon00 method and put everything into an ini.
Anyway, I set this event to trigger every 2 hours.
Inside the script, you need to change addr_code to your device code that you use. I set mine to W5, which is the device that I used to use with Jon00's script.
Finally, save the 5 PNG files into the /images/pollen folder (should exist if you used Jon00's PollenUS script).
Run and see what happens.
I found a way to validate the "format" of the zipcode and according to the site I got it from (which is credited), this SHOULD actually work for both Canada and US.
I updated this to v1.3, seems the webscraping stuff was not working. I left it in for nostalgia reasons, but I lifted the other code (with reference and credit) from stackoverflow (where would the hacks be without that site?!). Anyway, I ran it for all of 30 seconds and it seems to be working now.
Whatever was going on, I had to really kludge the scraping of the value form the webpage.
Anyway, here it is, seems to work.
Copy the .txt file to your script folder. Delete the _v1.1.txt extension, as this IS a .vb file.
You will need to create an event that runs a script:
dwr_pollen.vb("Main","ZipCode")
Main, is just main. Zipcode, you will need to change that to your zipcode.
I did this, as I was considering adding in a second "location", so this way, you can setup multiple locations. Maybe I'll follow Jon00 method and put everything into an ini.
Anyway, I set this event to trigger every 2 hours.
Inside the script, you need to change addr_code to your device code that you use. I set mine to W5, which is the device that I used to use with Jon00's script.
Finally, save the 5 PNG files into the /images/pollen folder (should exist if you used Jon00's PollenUS script).
Run and see what happens.
I found a way to validate the "format" of the zipcode and according to the site I got it from (which is credited), this SHOULD actually work for both Canada and US.
I updated this to v1.3, seems the webscraping stuff was not working. I left it in for nostalgia reasons, but I lifted the other code (with reference and credit) from stackoverflow (where would the hacks be without that site?!). Anyway, I ran it for all of 30 seconds and it seems to be working now.
Comment