Your forum username:
Do you already have an account?
Forgot your password?
  • Log in or Sign up


    Welcome to Sky User - The Unofficial Support Forum for everything Sky! - Proudly helping over 65k members.


    Advertisement

    Page 2 of 2 FirstFirst 12
    Results 11 to 16 of 16

    Does anyone know where the online Sky program guide gets it's time info from?

    This is a discussion on Does anyone know where the online Sky program guide gets it's time info from? within the Sky & Sky+ TV forums, part of the Other Sky help and support category; Yes I had something similar: Code: #!/usr/bin/bash echo $((`date '+%s'`+5*3600))000 >~/timeInMinutes until I realised that the JavaScript within the tv-guide ...

    1. #11
      seawright's Avatar
      seawright is offline Sky User Member
      Exchange: 02392
      Broadband ISP: Other ISP
      Router: Non Sky Router
      Sky TV: Sky+HD box
      Join Date
      Jul 2012
      Posts
      3,456
      Thanks
      65
      Thanked 379 Times in 369 Posts

      Re: Does anyone know where the online Sky program guide gets it's time info from?

      Yes I had something similar:
      Code:
      #!/usr/bin/bash
      echo $((`date '+%s'`+5*3600))000 >~/timeInMinutes
      until I realised that the JavaScript within the tv-guide would substitute local time if the value "1" received from timeInMinutes did not make sense in the current context.
      This didn't really help as although it moved the yellow line to the correct time it no longer corresponded with the TV programme actually being broadcast.


    2. Advertisement
    3. #12
      dewdude's Avatar
      dewdude is offline Sky User Member
      Exchange: Verizon
      Broadband ISP: Verizon FiOS (Fibre)
      Router: Non Sky Router
      Sky TV: Sky+HD box
      Join Date
      Feb 2014
      Location
      Manassas, VA - USA
      Posts
      88
      Thanks
      5
      Thanked 3 Times in 3 Posts
      Blog Entries
      1

      Re: Does anyone know where the online Sky program guide gets it's time info from?

      Quote Originally Posted by seawright View Post
      Yes I had something similar:
      Code:
      #!/usr/bin/bash
      echo $((`date '+%s'`+5*3600))000 >~/timeInMinutes
      until I realised that the JavaScript within the tv-guide would substitute local time if the value "1" received from timeInMinutes did not make sense in the current context.
      This didn't really help as although it moved the yellow line to the correct time it no longer corresponded with the TV programme actually being broadcast.
      Right. In my case, it always seems to be pulling an offset from somewhere. If i change time zone on my tablet, the yellow line moved. But, ive been completely unable to display it at anything but my local time regardless.

      Its getting the proper utc time from sky, but the javascript somehow knows I am five hours behind. Trying to shift the timestamp 5 hours ahead and inserting it doesnt even work, its like its ignoring my system time all together, yet knows what it is.

      I haven't played with it at all today. I dont know javascript all that well, but i also dont know python very well.

      Sent from my Transformer TF101 using Tapatalk
      FTTP Service: (speed upgrade to 75/75 as of 23/7/2014)



    4. #13
      seawright's Avatar
      seawright is offline Sky User Member
      Exchange: 02392
      Broadband ISP: Other ISP
      Router: Non Sky Router
      Sky TV: Sky+HD box
      Join Date
      Jul 2012
      Posts
      3,456
      Thanks
      65
      Thanked 379 Times in 369 Posts

      Re: Does anyone know where the online Sky program guide gets it's time info from?

      This looks like an interesting bit of javascript:
      http://tv.sky.com/static/ky90KU9h4UX...cLu2JqxOBla.js

      Code:
      (function(global, $) {
      
          skytv.timeInMinutesRequest = function() {
              return $.ajax({
                  url: skytv.Helper.createLink({
                      controller: 'info',
                      action: 'timeInMinutes',
                      format: 'html'
                  }),
                  timeout: 2000,
                  dataType: 'text',
                  success: function(data, status, response) {
                      var date;
                      if (skytv.testEnv || response.getResponseHeader('date') === null) {
                          // Needed for bizarre IE behaviour...
                          //
                          data = data.replace(/\s/g, '');
                          date = new Date(parseInt(data, 10));
                      } else {
                          date = new Date(Date.parse(response.getResponseHeader('date')));
                      }
                      skytv.nowEpochTime = date.valueOf() / 1000;
                      skytv.timeInMinutes = date.getHours() * 60 + date.getMinutes();
                      global.setInterval(function() {
                          skytv.nowEpochTime = skytv.nowEpochTime + 60;
                      }, 60000);
                  }
              });
          };
      
      }(window, jQuery));
      In particular:
      skytv.timeInMinutes = date.getHours() * 60 + date.getMinutes();

    5. The Following User Says Thank You to seawright For This Useful Post:

      dewdude (25-02-14)

    6. #14
      dewdude's Avatar
      dewdude is offline Sky User Member
      Exchange: Verizon
      Broadband ISP: Verizon FiOS (Fibre)
      Router: Non Sky Router
      Sky TV: Sky+HD box
      Join Date
      Feb 2014
      Location
      Manassas, VA - USA
      Posts
      88
      Thanks
      5
      Thanked 3 Times in 3 Posts
      Blog Entries
      1

      Re: Does anyone know where the online Sky program guide gets it's time info from?

      Well, looks like I found what's going to drive me to learn Javascript. I largely have no reason to do this and at this point, it's just for the useless sense of success I'll feel when I figure it out.

    7. #15
      seawright's Avatar
      seawright is offline Sky User Member
      Exchange: 02392
      Broadband ISP: Other ISP
      Router: Non Sky Router
      Sky TV: Sky+HD box
      Join Date
      Jul 2012
      Posts
      3,456
      Thanks
      65
      Thanked 379 Times in 369 Posts

      Re: Does anyone know where the online Sky program guide gets it's time info from?

      Well I'm sure there are more elegant ways to achieve it but here's my solution:
      Code:
                      skytv.nowEpochTime = date.valueOf() / 1000;
      -               skytv.timeInMinutes = date.getHours() * 60 + date.getMinutes();
      +               minutes = date.getHours() * 60 + date.getMinutes();
      +               skytv.timeInMinutes = (minutes + 300) % 1440;
                      global.setInterval(function() {
      I wanted to wait until after midnight GMT to make sure it handled new day correctly.
      Now I can change my locale back to London.
      I checked on the web archive and Interestingly /info/timeInMinutes has changed its format:
      https://web.archive.org/web/20120107.../timeInMinutes

    8. The Following User Says Thank You to seawright For This Useful Post:

      dewdude (26-02-14)

    9. #16
      dewdude's Avatar
      dewdude is offline Sky User Member
      Exchange: Verizon
      Broadband ISP: Verizon FiOS (Fibre)
      Router: Non Sky Router
      Sky TV: Sky+HD box
      Join Date
      Feb 2014
      Location
      Manassas, VA - USA
      Posts
      88
      Thanks
      5
      Thanked 3 Times in 3 Posts
      Blog Entries
      1

      Re: Does anyone know where the online Sky program guide gets it's time info from?

      Absolutely genius! A million thank yous! Elegant or not, it works. Told Fiddler to serve modified script, reloaded the guide, now this feels authentic.

      Thank you!


     

     
    Page 2 of 2 FirstFirst 12

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •  
    SkyUser - Copyright © 2006-2017. SatDish and NewsreadeR | SkyUser is in no way affiliated with Sky Broadband / BSkyB
    RIPA NOTICE: NO CONSENT IS GIVEN FOR INTERCEPTION OF PAGE TRANSMISSION