Announcement

Collapse
No announcement yet.

Bible Verse of the Day Script

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

    Bible Verse of the Day Script

    I took the code from the "word for the day" script we discussed yesterday and found a site that does Bible Verse of the day...

    It's from an ESV (english standard version)

    VerseOfTheDay.vb
    Code:
    Imports System.IO
    Imports System.Xml
    Sub Main(parm as object)
       Dim m_xmld As XmlDocument
       Dim m_node As XmlNode
       Dim CHverse as xmlNode
       dim tverse as xmlNode
     
       m_xmld = New XmlDocument
       m_xmld.Load("http://www.gnpcb.org/esv/share/rss2.0/daily/")
       CHverse = m_xmld.SelectSingleNode("rss/channel/item/title")
       tverse = m_xmld.SelectSingleNode("rss/channel/item/description")
     
     
       hs.speak ("The Verse for the day is from " & CHverse.InnerText &". The Verse is. . " & tverse.InnerText)
     
     
    End Sub
    Nothing special... but thought i might save someone some legwork if i shared.

    Andrew
    Regards,

    Andrew B.

    #2
    Excellent Andrew. Could you please put this in the script library with the appropriate label ([VB.NET Script] )so it will be easier to find in the future?
    -Rupp
    sigpic

    Comment


      #3
      Problem with script.

      I have this error when running this script:

      1/27/2007 9:22:18 AM - Error - Script compile error: Type 'XmlDocument' is not defined.on line 17
      1/27/2007 9:22:18 AM - SCR - Option Strict OffImports System.IOImports System.Xmlimports Schedulerimports SystemPublic Module scriptcode2#Region "Automatically generated code, do not modify"'Automatically generated code, do not modify'Event Sources Begin <SYSTEM.CONTEXTSTATICATTRIBUTE()>Public WithEvents hs As Scheduler.hsapplication <SYSTEM.CONTEXTSTATICATTRIBUTE()>Public WithEvents hsp As scheduler.hsp <SYSTEM.CONTEXTSTATICATTRIBUTE()>Public WithEvents hssystem As scheduler.phone0'Event Sources End'End of automatically generated code#End RegionSub Main(parm as object) Dim m_xmld As XmlDocument Dim m_node As XmlNode Dim CHverse as xmlNode dim tverse as xmlNode m_xmld = New XmlDocument m_xmld.Load("http://www.gnpcb.org/esv/share/rss2.0/daily/") CHverse = m_xmld.SelectSingleNode("rss/channel/item/title") tverse = m_xmld.SelectSingleNode("rss/channel/item/description") hs.speak ("[Loc All] The Verse for the day is from " & CHverse.InnerText &". The Verse is. . " & tverse.InnerText) End SubEnd Module


      I do have the System.XML.dll add to Settings.ini as follows:

      ScriptingReferences=Classes;C:\Program Files\HomeSeer\Classes.dll;System.XML;System.XML.dll


      I don't know what I am doing wrong.

      Thanks.
      <!-- / message --><!-- sig -->__________________
      -Larry

      A member of "The HA Pioneer Group", MyWebSite

      Plugins:
      VWS, AB8SS, lrpSpeak, Calendar, Arduino, Harmony, BlueIris, Sprinklers, ZipBackup...

      Hardware:
      Intel NUC8i7BEH1 running Windows 10 Pro headless, HS3 Pro, Plex running on Synology dual High Availability DS-1815+ NAS (24Tb each), Synology Surveillance Station running on DS-416 Slim (8Tb), Samsung SmartThings, Google Home, Alexa, Hubitat Elevation, ZNET, Ubiquiti UniFi Network, Davis Vantage Pro II Weather Station. Whole house speaker system using a couple of AB8SS switches. Vantage Pro II Weather Station, Rain8Net Sprinklers, Hubitat Elevation, Google Home, Alexa, DSC Security System, Ubiquiti UniFi Network.

      Comment


        #4
        Make sure your script file is named with a .vb extension.. not a .txt...

        I got errors similar when i used the wrong extension...

        ?

        Just guessing here..

        Andrew
        Regards,

        Andrew B.

        Comment


          #5
          Larry,

          I have a suspicion that Homeseer is not reading more than one class in its scripting references entry.

          Just try:

          ScriptingReferences=System.XML;System.XML.dll

          Does it now work?

          Edit - I've just seen that your scriptingReferences is entered incorrectly.

          It should be with a comma i.e.

          ScriptingReferences=Classes;C:\Program Files\HomeSeer\Classes.dll,System.XML;System.XML.dll

          Does that work?
          Jon

          Comment


            #6
            Thanks Jon, the comma did the trick. And thanks for a great script Andrew.

            Larry.
            -Larry

            A member of "The HA Pioneer Group", MyWebSite

            Plugins:
            VWS, AB8SS, lrpSpeak, Calendar, Arduino, Harmony, BlueIris, Sprinklers, ZipBackup...

            Hardware:
            Intel NUC8i7BEH1 running Windows 10 Pro headless, HS3 Pro, Plex running on Synology dual High Availability DS-1815+ NAS (24Tb each), Synology Surveillance Station running on DS-416 Slim (8Tb), Samsung SmartThings, Google Home, Alexa, Hubitat Elevation, ZNET, Ubiquiti UniFi Network, Davis Vantage Pro II Weather Station. Whole house speaker system using a couple of AB8SS switches. Vantage Pro II Weather Station, Rain8Net Sprinklers, Hubitat Elevation, Google Home, Alexa, DSC Security System, Ubiquiti UniFi Network.

            Comment


              #7
              i got the same error, i placed

              ScriptingReferences=Classes;C:\Program Files\HomeSeer\Classes.dll,System.XML;System.XML.dll

              at the very end of the settings.ini, cause i didn't know where else to put it, is that the wrong spot?
              Plugins:
              BLLogMonitor, BLGarbage, BLBackup, BLOutGoingCalls, BLUps, BLRfid, JvEss, DooMotion, Applied Digital Ocelot, AC RF Processor, UltraMon, PJC AVR 430, UPB, Rain8net, DSC Panel, JRiver Media center, Windows Media Player, SageMediaCenter, SnevlCID, MCSTemperature.

              Comment


                #8
                1) In Settings.ini, find the very first line which should be: [Settings]
                2) Add a new line underneath this and add: ScriptingReferences=System.XML;System.XML.dll
                3) Delete the entry that you added before.
                Jon

                Comment

                Working...
                X