Jump to content

IE_bodyyreadtext specific table


Recommended Posts

im trying to get this to read me the weather as a wake up call (like that scene in iron man where his computer is on his window)i have my computer hooked up to a fla tscreen+surround sound :huh2:

but i would like to get it to only read part of the table rather then everything, ie 'weather line' rather then 'barometer'. is this just a parameter in IE_bodyyreadtext?

#include <IE.au3>


$oIE = _IEcreate ("http://mobile.weather.gov/port_mp_ns.php?select=3&CityName=Hayward&site=MTR&State=CA&warnzone=CAZ508")
$stext = _IEBodyReadText($oIE)

Speak ("good morning Sir, Begining your Morning weather reoprt " & $stext) 
Func Speak($sText)
    Local $o_speech = ObjCreate("SAPI.SpVoice")
    With $o_speech 
        .Rate=.01
        .Volume=100
        .Speak ($sText)
    EndWith
EndFunc
sleep (3000)

ShellExecute ("http://www.accuweather.com/us/ca/hayward/94540/city-weather-forecast.asp")
<--a good way to start you day
Link to comment
Share on other sites

All of the text is packed into a single element, so you have to parse it out with String functions, for example:

#include <IE.au3>
#include <Array.au3>

$oIE = _IEcreate ("http://mobile.weather.gov/port_mp_ns.php?select=3&CityName=Hayward&site=MTR&State=CA&warnzone=CAZ508")
$sText = _IEBodyReadText($oIE)
$aText = StringRegExp($sText, "(?:Weather\: |Temperature\: )(.+)", 3)

Speak ("Weather is " & $aText[0] & ", and temperature is " & $aText[1])

Func Speak($sText)
    Local $o_speech = ObjCreate("SAPI.SpVoice")
    With $o_speech
        .Rate=.01
        .Volume=100
        .Speak ($sText)
    EndWith
EndFunc

:huh2:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...