What's the weather for tomorrow in Orlando?
What's the weather in Las Vegas on Thursday?
What's the weather?
What's the weather for tomorrow?
What's the weather in Orlando?
What's the weather for today in Santos?
The phrases and payloads were originally written in portuguese.
But I have quickly translated them to post here. And in this newer and significantly better version I'm not going to translate the displaying text since you can easily find the strings to be translated in the python script and then use Google translator to translate them.
The advantage of this xml against the other posted xmls (that I could find at least), is that this one can have both the location and the day as optional payload xml's.
So I can say any of the above phrases with a single command and it will work perfectly.
You must add your locations to the file weather_locations.xml so you can use it. This file contains a the actual weather station respective to the place you are asking the weather for. Please pay attention to weather stations that you will have to use a format like pws:ISANTOS10 or others that don't have the pws: like this KORL. Look in the respective payload xml (weather_locations.xml) for examples.
Visit this URL for getting your respective weather station:
http://www.wunderground.comIn the latest version I've transferred all the logic to python because it is easier to me and probably more flexible that being limited only to VC native macros.
The latest version will not change your default location (as set in the script, variable defaultlocation on line 24) if you don't request it. Once you change a location, all the further requests for the forecast will be made for this same location, unless you change the location again by saying another specific location in your phrase. The other condition for the code to execute a change action is if there is no data available from the plugin, hence a new download of information would be required anyway.
When you don't say a location at all, the script will get the location name from the plugin variables using the variable C.observation_location. So you never miss what location is actually being displayed.
The script will always tell the actual weather station where the weather data came from so you can always make sure the weather being displayed is the one that you really wanted to know.
The day is also now show in both weekday and day of the month so you never misunderstand what day is actually being displayed.
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.5.2-->
<commandGroup open="True" name="Previsão do tempo-EN" enabled="True" prefix="" priority="0" requiredProcess="" description="">
<command id="753" name="Qual a previsão do tempo para <dia> em <local> (python)" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>TTS.Speak</cmdType>
<params>
<param>I'm getting the weather for ya.|Ok, let me get it|I'll get it quickly for you.</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>PY.ExecString</cmdType>
<params>
<param>weather_forecast("{1}","{PF.1}","{2}","{PF.2}")</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>what's the weather,how is the weather</phrase>
<phrase optional="true">in,on,for,at</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="True">payloads\weather_locations.xml</payloadFromXML>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="True">payloads\weather_day.xml</payloadFromXML>
<phrase optional="true">in,on,for,at</phrase>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="True">payloads\weather_day.xml</payloadFromXML>
<payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone" optional="True">payloads\weather_locations.xml</payloadFromXML>
</command>
<command id="352" name="Query current Wunder Settings" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>WUnder.GetCustom</cmdType>
<params>
<param>{C.observation_location.full}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.ShowText</cmdType>
<params>
<param>{LastResult}</param>
<param>10000</param>
<param>1</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>RegExTool.Open</cmdType>
<params>
<param>True</param>
</params>
<cmdRepeat>0</cmdRepeat>
</action>
<action>
<cmdType>Results.RegEx</cmdType>
<params>
<param>"full":\s"(.*?)",</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.AddText</cmdType>
<params>
<param>{Match.1}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>WUnder.GetCustom</cmdType>
<params>
<param>{C.station_id}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<action>
<cmdType>OSD.AddText</cmdType>
<params>
<param>{LastResult}</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<phrase>Query current weather settings</phrase>
</command>
<command id="301" name="load python script" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
<action>
<cmdType>PY.ExecFile</cmdType>
<params>
<param>PY\weather_forecast_Marcus.py</param>
</params>
<cmdRepeat>1</cmdRepeat>
</action>
<event>VC.Loaded</event>
</command>
</commandGroup>
This is the final version of the script. Please report any bugs so I can fix them.