Announcement

Collapse
No announcement yet.

Need a little help with scripting procedure

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

    Need a little help with scripting procedure

    I would like to have this html parsed to read the headline, and then the story right after it. After it reads the first headline, go to the next and do the same thing, and then when it finished the last headline and story, stop. I just need to know the commands. Attached is the html:
    Attached Files

    #2
    What the URL to this page? It's would be easier to see what's involved to be able to load the regular URL .

    -Rupp
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Sure,

      The url to the page is:

      http://www.cubuffs.com/SportSelect.d...255&SPSID=3843

      Comment


        #4
        The url you posted looks nothing like the html code you posted? Are you sure its the same page.

        -Rupp
        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

        Comment


          #5
          Yes, it is. I only posted a small portion of the page. It is a pretty big page, that's why I didn't post it.

          Comment


            #6
            Have you used hs.GetURLIE yet? If so this page isn't going to be too bad because it appears they use a class ID of Headline for each headline. So The first thing to do is to is to grab the page information using getURLIE and search for CLASS="headline">. Is this enough to get you going?

            -Rupp
            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

            Comment


              #7
              Well,

              I know how to do this:

              sub main()
              Dim strSite
              Dim strDocument
              Dim strBody
              Dim x

              strSite="http://www.cubuffs.com"
              strDocument="/SportSelect.dbml?DB_OEM_ID=600&KEY=&SPID=255&SPSID=3843"
              strBody=hs.GetURl(strSite,strDocument,false,80)

              strBody=Replace(strBody,chr(9),"")
              strBody=Replace(strBody,chr(10),"")
              strBody=Replace(strBody,chr(13),"")

              x=Instr(1,strBody,"headline",1)
              strBody=Mid(strBody,x)
              x=Instr(1,strBody,"headline",1)+10
              strBody=Mid(strBody,x)
              x=Instr(1,strBody,"</font>",1)-1
              strBody=Mid(strBody,1,x)

              hs.writelog "debug", strBody
              hs.speak strBody
              hs.SetDeviceString "v5",strBody

              strSite="http://www.cubuffs.com"
              strDocument="/SportSelect.dbml?DB_OEM_ID=600&KEY=&SPID=255&SPSID=3843"
              strBody=hs.GetURl(strSite,strDocument,false,80)

              strBody=Replace(strBody,chr(9),"")
              strBody=Replace(strBody,chr(10),"")
              strBody=Replace(strBody,chr(13),"")

              x=Instr(1,strBody,">CUBuffs.com,",1)
              strBody=Mid(strBody,x)
              x=Instr(1,strBody,"<BR>",1)+4
              strBody=Mid(strBody,x)
              x=Instr(1,strBody,"<BR>",1)-1
              strBody=Mid(strBody,1,x)

              hs.writelog "debug", strBody
              hs.speak strBody
              hs.SetDeviceString "v5",strBody

              end sub

              But, I want to combine all the headlines somehow into a subroutine so I don't have to keep writing the same thing over and over

              Comment


                #8
                <pre class="ip-ubbcode-code-pre">
                sub main()
                Dim strSite
                Dim strDocument
                Dim strBody
                Dim x

                strSite = "http://www.cubuffs.com"
                strDocument = "/SportSelect.dbml?DB_OEM_ID=600&KEY=&SPID=255&SPSID=3843"
                strBody = hs.GetUrl(strSite, strDocument, True, 80)

                strBody = Replace(strBody, Chr(9), "")
                strBody = Replace(strBody, Chr(10), "")
                strBody = Replace(strBody, Chr(13), "")

                intStart = InStr(1, strBody, "Football - Releases")
                intNStart = InStr(intStart + 1, strBody, "Football - Releases")

                Do While InStr(intNStart, strBody, "(Get The Full Story)") &gt; 0
                intEnd = InStr(intNStart, strBody, "(Get The Full Story)") + 20
                FirstHeadLine = Mid(strBody, intNStart, intEnd - intNStart)
                Msgbox( FirstHeadLine)
                intNStart = intEnd + 1
                Loop
                end sub
                </pre>

                -Rupp
                💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                Comment

                Working...
                X