This Post is an extension to Talk With Your Computer like Jarvis in Iron Man , So, Before forwarding to continue reading...It is recommended to Read linked article.
Know Weather of Your Favorite City By Voice Command :
<?xml version="1.0" encoding="utf-8"?>
<speechMacros>
<command>
<listenFor>what is the weather in [CityName]</listenFor>
<run command="http://www.weather.com/weather/local/{[CityName.zipCode]}"/>
</command>
<command>
<listenFor>Tell me the weather forecast for [CityName]</listenFor>
<speak>OK</speak>
<script language="JScript">
var xml_doc = new ActiveXObject("Microsoft.XMLDOM");
xml_doc.async = false;
xml_doc.load("http://www.rssweather.com/zipcode/{[CityName.zipCode]}/rss.php");
var titles = xml_doc.getElementsByTagName("title");
var descriptions = xml_doc.getElementsByTagName("description");
Application.Speak(titles.item(2).text + " in {[*CityName]}");
Application.Speak(descriptions.item(2).text);
</script>
</command>
<listenForList name="CityName" propname="zipCode">
<item propval="City Zip Code">City_name</item>
<item propval="City Zip Code">City_name</item>
<item propval="City Zip Code">City_name</item>
<item propval="City Zip Code">City_name</item>
<item propval="City Zip Code">City_name</item>
</listenForList>
Note : Only Change the TEXT in RED to personalize your command and Put corresponding Zip code to the City name.
No comments:
Post a Comment