Advertisement
kiler129

TV Guide JSON-URL sample

Apr 29th, 2012
621
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 4.04 KB | None | 0 0
  1. <?php
  2.  /*
  3.     **** Sample EPG ****
  4.     Script should return only EPG for day specified in $_GET["d"].
  5.     Day is formated in standard MySQL format: YYYY-MM-DD.
  6.     If no date is specified (or it's invalid) code should return EPG for current day.
  7.   */
  8.  
  9.  $epg = array(
  10.                array(
  11.                      "i" => "sample-station", //Unique station id
  12.                      "c" => (int)123, //Station id send to player
  13.                      "n" => "Sample Station", //Human readable station name
  14.                      "l" => "http://example.com/logo.png", //Station logo to display
  15.                      "p" => array(
  16.                                   array(
  17.                                         "s" => (float)1335614400, //Program start timestamp [UTC]
  18.                                         "e" => (float)1335615000, //Program end timestamp [UTC]
  19.                                         "t" => "Sample Program", //Program title
  20.                                         "d" => "This is a sample program, 10 mins", //Program description
  21.                                         "i" => "http://example.com/small_program_image.jpg",
  22.                                         "l" => "http://example.com/big_program_image.jpg"
  23.                                   ),
  24.                                   array(
  25.                                         "s" => (float)1335615000, //Program start timestamp [UTC]
  26.                                         "e" => (float)1335616800, //Program end timestamp [UTC]
  27.                                         "t" => "Sample Program", //Program title
  28.                                         "d" => "This is a sample program 30 mins" //Program description
  29.                                   ),
  30.                                   array(
  31.                                         "s" => (float)1335616800, //Program start timestamp [UTC]
  32.                                         "e" => (float)1335620400, //Program end timestamp [UTC]
  33.                                         "t" => "Sample Program", //Program title
  34.                                         "d" => "This is a sample program 1 hour" //Program description
  35.                                   )
  36.                                  )
  37.                     ),
  38.                     array(
  39.                      "i" => "sample-station-2", //Unique station id
  40.                      "c" => (int)321, //Station id send to player
  41.                      "n" => "Sample Station #2", //Human readable station name
  42.                      "l" => "http://example.com/logo2.png", //Station logo to display
  43.                      "p" => array(
  44.                                   array(
  45.                                         "s" => (float)1335614400, //Program start timestamp [UTC]
  46.                                         "e" => (float)1335615000, //Program end timestamp [UTC]
  47.                                         "t" => "Sample Program", //Program title
  48.                                         "d" => "This is a sample program, 10 mins" //Program description
  49.                                   ),
  50.                                   array(
  51.                                         "s" => (float)1335615000, //Program start timestamp [UTC]
  52.                                         "e" => (float)1335616800, //Program end timestamp [UTC]
  53.                                         "t" => "Sample Program", //Program title
  54.                                         "d" => "This is a sample program 30 mins" //Program description
  55.                                   ),
  56.                                   array(
  57.                                         "s" => (float)1335616800, //Program start timestamp [UTC]
  58.                                         "e" => (float)1335620400, //Program end timestamp [UTC]
  59.                                         "t" => "Sample Program", //Program title
  60.                                         "d" => "This is a sample program 1 hour" //Program description
  61.                                   )
  62.                                  )
  63.                     )
  64.              );
  65.              
  66.   echo json_encode($epg);
  67. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement