Announcement

Collapse
No announcement yet.

url monitoring? is there a way ?

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

    url monitoring? is there a way ?

    I want to be able to have homeseer look at a particular url and tell me how many charatures are on that page. thus counting the amount of text on a page, does anyone know how i would do this?
    detail of setup in profile. Link to videos of my projects there as well. Over 300 scripts running every min and counting

    #2
    If you are familiar with scripting, it's pretty easy. Just use hs.Geturl to get the data, put it into a string, and strip the spaces and linefeeds if you don't want those included in the count. Then use Len() to count the length of the string.
    HSPRO 2.4 (ESXi 4.1) | my.Alert NEW | my.Trigger | HSTouch | ACRF2 | UltraM1G | BLWeather | BLLan | Rover
    (aka xplosiv)
    Do You Cocoon? Home Automation News, Tutorials, Reviews, Forums & Chat

    Comment


      #3
      can you give me an example of the len string in use?
      detail of setup in profile. Link to videos of my projects there as well. Over 300 scripts running every min and counting

      Comment


        #4
        Code:
        sub main()
          strData = hs.GetUrl("http://www.cnn.com","/",false,80)
          ' remove tabs (if you care)
          strData = Replace (strData, chr(9), "",1,-1,1)
          ' remove carriage returns and line feeds
          strData = Replace (strData, chr(10),"",1,-1,1)
          strData = Replace (strData, chr(13), "",1,-1,1)
          hs.writelog "count result", len(strData) & " characters were found in strData"
        end sub
        I didn't test this code, but it should do the job. If all you are trying to do is to see if a page changed, you don't have to strip those characters.
        HSPRO 2.4 (ESXi 4.1) | my.Alert NEW | my.Trigger | HSTouch | ACRF2 | UltraM1G | BLWeather | BLLan | Rover
        (aka xplosiv)
        Do You Cocoon? Home Automation News, Tutorials, Reviews, Forums & Chat

        Comment


          #5
          yay that worked. thanks
          detail of setup in profile. Link to videos of my projects there as well. Over 300 scripts running every min and counting

          Comment

          Working...
          X