Announcement

Collapse
No announcement yet.

[VB.NET] dwr_pollen.vb

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    [VB.NET] dwr_pollen.vb

    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.
    Attached Files
    Last edited by drozwood90; April 29, 2016, 10:43 AM. Reason: more info.
    Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

    #2
    Added discussion thread:
    http://forums.homeseer.com/showthread.php?p=1132291
    Tasker, to a person who does Homeautomation...is like walking up to a Crack Treatment facility with a truck full of 3lb bags of crack. Then for each person that walks in and out smack them in the face with an open bag.

    Comment

    Working...
    X