Announcement

Collapse
No announcement yet.

Next Show

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

    Next Show

    Hi CFGUY

    Just a quick one, is there any way (through script) to query the show that is coming up next on a particular channel without having to set favorites etc.

    Its a bit of a different example, but id like to be able to tweet or take script action when the TV channel is changed to say TEN, it would be able to tweet "About to watch ShowTitle on TEN" where in a script i can query CHANNELNAME and it returns the show starting next on that channel?

    Id be keen just to get the show name in plaintext format.

    Thanks again.
    HS3 PRO, Win10, WeatherXML, HSTouch, Pushover, UltraGCIR, Heaps of Jon00 Plugins, Just sold and about to move so very slim system.

    Facebook | Twitter | Flickr | Google+ | Website | YouTube

    #2
    How do you know when you have changed the channel?
    If you are using your remote control how does HS know what channel you have changed to?


    You could use the function
    getVariableString

    In a script you would call it as

    &hs.plugin("HSTV").getVariableString(channelID, starttime, stringToReplace, channelNumber)

    You don't have to send both channelID and channelNumber, just one of the two.

    The params are:
    * channelID - the id of the channel from the Channel Editor page
    * starttime - the starttime of the show. Doesn't have to be the exact start time. The function will look for a show that has a starttime that is before the time you send to the function and the endtime is after the time you send to the function.
    * stringToReplace - when you setup a speak action on a control item there is a list of replacement variables. You can use any of those variables in this string. Including the isblank tag.
    * channelNumber - the channel number from the Channel Editor page

    As an example
    If TEN is channel 300 and you want what is on right now

    [code]

    sMsg = "I'm watching #showTitle# on #chanNick# <ISBLANK=#SHOWEPISODE#>The episode is #showEpisode#.</ISBLANK>"

    sVar = hs.plugin("HSTV").getVariableString("", Now, sMsg, "300")

    [/code

    To get just the show name set sMsg="#showTitle#"
    To get the next show you would have to know when the current show ends so it would take two calls to the plugin.

    Use this function in a script, call it with the channel number that you are tuning to.
    Code:
     
    Function getNextShow(ByVal sChannelNumber as String)
        Dim dDate as DateTime
        Dim sMsg as String = "#showDateDisp# #showEndDisp#"
        Dim sDate, sVar as String
        dDate = Now()
        sDate = hs.plugin("HSTV").getVariableString("", dDate, sMsg, sChannelNumber)
        dDate = sDate
        dDate = dDate.AddMinutes(5)
     
        sMsg = "I am getting ready to watch #showTitle# on #chanNick# at #showTimeDisp#"
        sVar = hs.plugin("HSTV").getVariableString("",sDate,sMsg,sChannelNumber)
     
       hs.WriteLog("HSTV",sVar)
    End Function
    tweet or speak sVar
    --
    Jeff Farmer
    HS 3, HSPhone
    My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
    Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave

    Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2

    Comment


      #3
      Good Morning,

      I was taking a look at this script again to see if i could use it for hstouch, and it looks like a good way to be able to control what is going to potential be shown next.

      I was wondering though, is there any way this could be used to pull a number of shows out of the database, what i would like to do is to be able to show in a listbox the shows that are starting next, in the format of:


      #showTitle# on #chanNick# at #showTimeDisp#"</pre>

      I would still be setting it (at the moment per channel), but eventually ideally id love to be able to have a time period (e.g. 2 hours), and be able to pull out the name of all of the shows, and have them as a listbox, and i thought this might be the best way of doing it.

      I didn't really have much of a question in that, anyway is there a way i could have an array of the phrases, e.g. as above that could be fed into another script, so the array would be i guess all shows starting within the time period X, for a specific channel, for the next X hours (e.g. 2 hours), and going from that, is there a way i could then expand that to include shows for all channels for the next few hours?
      HS3 PRO, Win10, WeatherXML, HSTouch, Pushover, UltraGCIR, Heaps of Jon00 Plugins, Just sold and about to move so very slim system.

      Facebook | Twitter | Flickr | Google+ | Website | YouTube

      Comment


        #4
        I think for it to be a listbox in HSTouch, I would have to have you call a function that creates an xml file that the listbox reads from.

        Would that work for what your wanting?
        --
        Jeff Farmer
        HS 3, HSPhone
        My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
        Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave

        Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2

        Comment


          #5
          Jeff,

          Enjoying HSTV plugin. Having some trouble calling from a vb.net script... I am pretty new at this, can you tell what I am doing wrong here?

          Chris
          Attached Files

          Comment


            #6
            Originally posted by dcdelong View Post
            Jeff,

            Enjoying HSTV plugin. Having some trouble calling from a vb.net script... I am pretty new at this, can you tell what I am doing wrong here?

            Chris

            I put your script into an actual vb file in the scripts directory and ran it.
            It correctly put the info into the HS log.
            I don't if it has anything to do with the version of visual studio.
            HSTV is maintained in VS 2005.
            --
            Jeff Farmer
            HS 3, HSPhone
            My HS3 Plugins: CFHSExtras, Random, Restart, Tracker, WeatherXML, PanaBluRay
            Other Plugins In Use: APCUPSD, BLOnkyo, Device History, EasyTrigger, HSTouch Server, PHLocation2, Pushover, RFXCom, UltraGCIR3, UltraMon3, UltraPioneerAVR3, X10, Z-Wave

            Hardware: GoControl Irrigation Controler, Schlage Lever Lock, Schlage Deadbolt, Way2Call Hi-Phone, RFXCom RFXrec433 Receiver, WGL 800, TI-103, Z-Net, Pioneer 1120, Pioneer 1021, Pioneer LX302, Panasonic BDT-110, Panasonic BDT-210 x2

            Comment


              #7
              Ahhh..... ok that could be. I did not publish it to HS, just ran it from the VS debugger... will try it tonight.

              Thank you much,

              Chris

              Comment

              Working...
              X