Announcement

Collapse
No announcement yet.

Oil per Barrel Price Script

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

  • drozwood90
    replied
    So, what are you using this for? Just curiosity information? Are you trying to fill your car on "the" correct day to save $$?

    --Dan

    Leave a comment:


  • HomeTech
    replied
    YES that fixed it THANKS!!!

    Leave a comment:


  • Stuart
    replied
    This works now
    Attached Files

    Leave a comment:


  • mrhappy
    replied
    This is a quick way (there may be better ways),

    Code:
    Dim Strdata
    Dim LenStr
    
    Sub main()
    
    Strdata = hs.GetURL("www.quoteoil.com", "" & strZip, False, 80)
    
    LenStr = (Instr(strData, "< strong >") + 8) - (Instr(strData, "< /strong >") - 9)
    
    strQuote = Mid(StrData, Instr(strData, "< strong >") + 8, LenStr + 1)
    
    Strquote = "Oil is " & strquote
    system.speak "C:\program files\HomeSeer HS2\wave\ToneAnnounce.wav",False
    hs.WaitSecs 1
    hs.system.speak strquote
    virtualdevice = "N91"
    hs.SetDeviceString virtualdevice,"" & Strquote, True 
    
    End Sub
    Hopefully it works if the price goes above $100/barrel, thats the only problem I see - unless they change the page again

    The board has a problem as it tries to parse the < strong > tags, please take the spaces out when you copy it into a script...

    Leave a comment:


  • HomeTech
    replied
    Oil Price Script stopped working

    This was working but now when the script runs I get bellow:

    Speak ():Oil is $(document).ready(function() { $("#responsecontainer").fadeOut(75).load("reload.php").fadeI n(75); $("#responsecontainer2").fadeOut(75).load("reload2.php").fad eIn(75); var refreshId = setInterval(function() { $("#responsecontainer").fadeOut(75).load('reload.php?randval ='+ Math.random()).fadeIn(75); $("#responsecontainer2").fadeOut(75).load('reload2.php?randv al='+ Math.random()).fadeIn(75); }, 7500);});en ar es fr de ru zhPrice of OilLight sweet crude oil-->$91.69 per barrel

    I believe the web page changed a bit. Is there a fix that some one can offer? Thank you

    The script I am running is attached.
    Attached Files

    Leave a comment:


  • HomeTech
    replied
    The site that the script gets its info from has no price present.
    www.quoteoil.com

    Leave a comment:


  • sqhughes
    replied
    Originally posted by tman1
    Anyone else getting the above string when going to oilquote.com?

    Just wondering, Later Terry
    Yes, just got it this morning.


    Scott

    Leave a comment:


  • tman1
    replied
    Oil is $ per barrell

    Anyone else getting the above string when going to quoteoil.com?

    Just wondering, Later Terry
    Last edited by tman1; July 31, 2006, 01:44 PM. Reason: DISLEXIA

    Leave a comment:


  • HomeTech
    replied
    Don't know how I did that cut and past is all I did to start. Thanks Rupp (Hawk eye)
    I have corrected the previous post.

    Works great

    Leave a comment:


  • Stuart
    replied
    Hi,
    when i first posted the script, I had to make the file an attachment, it didnt like the format.
    Stuart

    Leave a comment:


  • Guest's Avatar
    Guest replied
    The second version does.

    Leave a comment:


  • Rupp
    replied
    Steve,
    The script posted doesn't have those lines. Maybe it was updated.

    HTML Code:
    Dim startint
    Dim Endint
    Dim Strdata
    
    Sub main()
    	
    	Strdata = hs.GetURL("www.quoteoil.com", "" & strZip, true, 80)
    
            Strdata = Replace (Strdata, chr(9), "")
            Strdata = Replace (Strdata, chr(10),"")
            Strdata = Replace (Strdata, chr(13), "")
            Strdata = Replace(Strdata,"<b>","")
            Strdata = Replace(Strdata,"<br >","")
            Strdata = Replace(Strdata,"</b>","")
            	
    	startint = InStr(Strdata, "$")
    	Endint = InStr(startint, Strdata, "per barrel") + 10
    	strquote = Trim(Mid(Strdata, startint, Endint - startint ))
    	
            Strquote= "Oil is " & strquote
            
    	hs.speak strquote
            end sub

    Leave a comment:


  • Guest's Avatar
    Guest replied
    Question, what is the purpose of replacing "" with ""? And why 3 times?
    Code:
    Strdata = Replace(Strdata,"","")
    Strdata = Replace(Strdata,"","")
    Strdata = Replace(Strdata,"","")

    Leave a comment:


  • HomeTech
    replied
    Thanks Stuart could not have do it with out you. Here is the script works fine.
    Attached Files
    Last edited by HomeTech; July 19, 2006, 06:12 AM.

    Leave a comment:


  • Stuart
    replied
    this will give you a start...
    Stuart
    Attached Files

    Leave a comment:

Working...
X