WSR Command Code To Know Weather of Any City


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.

Here are some Windows Speech Macros Code to Know the Weather of your favorite City or any City. You just have to edit the following codes according to your wish list. Here it is :

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

About | Contact | Disclaimer-Privacy Statement
©2013-2014 isearchfun.in All Rights Reserved.
Friends : bindassnet.in- An Internet Blog
Protected by Copyscape DMCA Takedown Notice Violation Search