Announcement

Collapse
No announcement yet.

Parsing brains trust :)

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

    Parsing brains trust :)

    Hello Brains Trust,

    I live in an area where we occasionally get floods. Our weather warning system here is very poor in terms of being able to use good data, it seems in the USA your system is much better in being able to specify a specific town and get warnings. In ours it is more of warnings across a 'region' which covers many towns and often the warnings will be for a whole region and in reality only a few towns will be affected.

    What i would like to do is be able to pull in river information from a river monitoring site not far from me. Would someone be able to give me a hand in terms of getting something that would be able to parse the below going.

    http://www.melbournewater.com.au/con....asp?SiteID=16

    There is a whole lot of information, but in reality there is only four things i am interested in:

    Station Value Flow As at 22-Apr-2012 5 PM : 16.468 Ml/day Level As at 22-Apr-2012 5 PM : 0.160 m Rainfall Since 9 AM 0.40 mm 24 hours to 9 AM 2.60 mm
    Those things being Flow, Level and rainfall. I don't care so much about having the string be well combined, really just having the string being the value with unit, and the actual value being the value without unit.

    What would be cool, is if the updated time / date could be set to be the as at date, for example 22-Apr-2012 5:00pm, but if not possible then i guess that should be in the string so i can make sure it is still working.

    Thanks for the help!
    HS3 PRO, Win10, WeatherXML, HSTouch, Pushover, UltraGCIR, Heaps of Jon00 Plugins, Just sold and about to move so very slim system.

    Facebook | Twitter | Flickr | Google+ | Website | YouTube

    #2
    Are you looking for someone to write a program to do what you want or are you looking for advice on how to go about it?
    Do you know how to display the page source?
    Are you familiar with string manipulation in vb?

    It looks to me like you can get started by copying the page source into a text string. It will look something like this:
    Code:
            Dim strFlooding As String = hs.GetURL("http://www.melbournewater.com.au", 
    
    "/content/rivers_and_creeks/rainfall_and_river_level_data/site.asp?SiteID=16&bhcp=1", False, 80)
    Then set a pointer where the data you are looking for begins. Something like this should work:
    Code:
            ' Find the start of the table
            intStartTable = InStr(1, strFlooding, "<!--CONTENTSTART-->", CompareMethod.Text)
    From there it's a matter of moving the pointer to each of the data items you want to retrieve using HTML code as your markers, then putting the text into HS device strings and values.
    Mike____________________________________________________________ __________________
    HS3 Pro Edition 3.0.0.548, NUC i3

    HW: Stargate | NX8e | CAV6.6 | Squeezebox | PCS | WGL 800RF | RFXCOM | Vantage Pro | Green-Eye | Edgeport/8 | Way2Call | Ecobee3 | EtherRain | Ubiquiti

    Comment


      #3
      Thanks,

      Extracting source and splitstring got me there in the end. I used some code that mrhappy had previously helped me with .

      Thanks for the help
      HS3 PRO, Win10, WeatherXML, HSTouch, Pushover, UltraGCIR, Heaps of Jon00 Plugins, Just sold and about to move so very slim system.

      Facebook | Twitter | Flickr | Google+ | Website | YouTube

      Comment

      Working...
      X