Announcement

Collapse
No announcement yet.

i'm Looking for a "word of the day script"

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

    i'm Looking for a "word of the day script"

    Anybody have a script that will get a word of the day from the web and store it in a virtual device so that hs can speak it?



    I searched and found one in the script library, http://board.homeseer.com/showthread...light=word+day

    but can't get it working correctly. I get the following error in the hs log: Running script, script run or compile error in file: WordOfTheDay.txt5:Invalid procedure call or argument: 'mid' in line 56 More info: Invalid procedure call or argument: 'mid'


    Any ideas?

    #2
    My guess is the website they parsed the data from has changed format and the thing would have to be re-written to pick data out of the new format.


    ~Bill

    Comment


      #3
      Dictionary.com also offeres this in an RSS feed

      http://dictionary.reference.com/wordoftheday/wotd.rss
      I'm betting the format of that isn't going to change much.

      I'll try and write a .net script to parse that tonight, as I'd like to get the word of the day also.

      he RSS feed looks like it doesn't have the Pronunciation, so I might have to do a screen scrape similar to how the old script worked.

      Either that, or maybe someone else offeres a better rss feed for word of the day.
      Joe (zimmer62)

      BLSecurtiy, AC-RF2, RCS Serial Thermostats, RFXCOM SMarthome SwitchLinc, mcsXap, Global Cache GC100, SqueezeBox, TWA_ONKYOINTEGRA, BLLogMonitor, BLPlugins, BLRadar, BLSpeech, BLZLog.aspx, HSTouch (Windows, iPhone, iPod), USB Mimo touchscreens, VMWare Server, Vortexbox, Windows Home Server, MyMovies, Windows Media Center, X10, ZWave, and much much much more.

      Comment


        #4
        Originally posted by zimmer62 View Post
        Dictionary.com also offeres this in an RSS feed

        http://dictionary.reference.com/wordoftheday/wotd.rss
        I'm betting the format of that isn't going to change much.

        I'll try and write a .net script to parse that tonight, as I'd like to get the word of the day also.

        he RSS feed looks like it doesn't have the Pronunciation, so I might have to do a screen scrape similar to how the old script worked.

        Either that, or maybe someone else offeres a better rss feed for word of the day.
        Thanks Joe!! I'll keep my eyes open.

        Comment


          #5
          Here's a quick and dirty script to parse the word of the day. Just put in in a file like WordOfTheDay.txt and run it using an event.

          Code:
          Sub Main
             Set objXMLDoc = CreateObject("MSXML2.DOMDocument.4.0")
             objXMLDoc.async = false
             objXMLDoc.load("http://dictionary.reference.com/wordoftheday/wotd.rss")
             set sData = objXMLDoc.selectSingleNode("rss/channel/item/description") 
             hs.speak (sData.text)
          End Sub
          Here's the same script in vb.net. To use this script you will need to add this line to your settings.ini file in the config directory. Search for ScriptingReferences and if it doesn't exist then add this line to your file.
          ScriptingReferences=System.XML;System.XML.dll

          Code:
          Imports System.IO
          Imports System.Xml
          Sub Main(parm as object)
             Dim m_xmld As XmlDocument
             Dim m_node As XmlNode
          
             m_xmld = New XmlDocument
             m_xmld.Load("http://dictionary.reference.com/wordoftheday/wotd.rss")
             m_node = m_xmld.SelectSingleNode("rss/channel/item/description")
             hs.speak (m_node.InnerText)
          
          End Sub
          Last edited by Rupp; January 23, 2007, 02:05 PM.
          💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

          Comment


            #6
            The script works fine Rupp.

            It says "supine: lying on the back; also, indolent; listless."

            Any way to speak just parts of the rss?

            Like "The word of the day is supine. The definition of supine is lying on the back; also, indolent; listless."

            This is for elementary aged kids. They would need to hear "The definition of......is"
            Last edited by ; January 23, 2007, 02:45 PM. Reason: grammar

            Comment


              #7
              If you don't want to bother about scripting then you can download my RSS news feed script which will do everything you want (and more!).

              Click on the banner below for my site access.
              Jon

              Comment


                #8
                Originally posted by jon00 View Post
                If you don't want to bother about scripting then you can download my RSS news feed script which will do everything you want (and more!).

                Click on the banner below for my site access.
                I did download it. Works great. Just cant figure out how to make hs speak what's in the status column on my device list page.

                Comment


                  #9
                  Oops - didn't see your post - go with Rupps script if you want to speak something different from the actual news feed.
                  Jon

                  Comment


                    #10
                    When did you download it? - its been updated to speak recently.
                    Jon

                    Comment


                      #11
                      Here is the modification to Rupp's script you wanted:

                      PHP Code:
                      Sub Main
                      Set objXMLDoc 
                      CreateObject("MSXML2.DOMDocument.4.0")
                      objXMLDoc.async false
                      objXMLDoc
                      .load("http://dictionary.reference.com/wordoftheday/wotd.rss")
                      set sData objXMLDoc.selectSingleNode("rss/channel/item/description"
                      MyWord=hs.stringitem(sData.text,1,":")
                      MyDefinition=hs.stringitem(sData.text,2,":")
                      hs.speak ("The word of the day is " MyWord ". The definition of " MyWord " is " MyDefinition)
                      End Sub 
                      Jon

                      Comment


                        #12
                        Here you go.
                        Code:
                        Sub Main
                           Set objXMLDoc = CreateObject("MSXML2.DOMDocument.4.0")
                           objXMLDoc.async = false
                           objXMLDoc.load("http://dictionary.reference.com/wordoftheday/wotd.rss")
                           set sData = objXMLDoc.selectSingleNode("rss/channel/item/description") 
                           splData = split(sData.text,":")
                           hs.speak ("The word of the day is " & splData(0) &". The definition of " & splData(0) & " is " & splData(1))
                        End Sub
                        💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                        Comment


                          #13
                          huh...makes a change to beat you Rupp!
                          Jon

                          Comment


                            #14
                            I must have been editing while your were posting.
                            I'm getting slow in my old age.
                            They can hear it in stereo now ...
                            💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

                            Comment


                              #15
                              Wow!!! This is incredible!!! BOTH of the scripts work great!!
                              Rupp and Jon....Do you guys have some type of Homeseer masters, doctorate, or PHD?

                              Thanks!



                              I think these scripts need to be added to the script library.

                              Comment

                              Working...
                              X