PHP code example of kubrey / epg-telemanpl

1. Go to this page and download the library: Download kubrey/epg-telemanpl library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kubrey / epg-telemanpl example snippets


  
 use teleman/EpgParser;
 
 $parser = new EpgParser();
 // to get channels page
 $data = $parser->loadChannels();
 if($data){
    $parser->parseChannels($data);
    var_dump($parser->getCategories());
    var_dump($parser->getChannels());
 }
 
 

array(29) {
  [0]=>
  array(7) {
    ["start"]=>
    string(4) "6:00"
    ["url"]=>
    string(31) "/tv/Taki-Jest-Swiat-348-1452241"
    ["name"]=>
    string(22) "Taki jest świat (348)"
    ["genre"]=>
    string(20) "program informacyjny"
    ["descr"]=>
    string(143) "Przegląd wydarzeń z całego świata. Widzowie zobaczą nie tylko wiadomości polityczne i gospodarcze, ale także informacje z życia gwiazd."
    ["channel"]=>
    string(4) "Puls"
    ["dateStart"]=>
    string(10) "2016-05-12"
    ["length"]=>
    int(50)
  }
  [1]=>
  array(7) {
    ["start"]=>
    string(4) "6:50"
    ["url"]=>
    string(21) "/tv/Super-2-5-1477379"
    ["name"]=>
    string(12) "Super! (2/5)"
    ["genre"]=>
    string(18) "program edukacyjny"
    ["descr"]=>
    string(183) " Zwykłym ludziom na całym świecie przydarzają się ciekawe, zaskakujące sytuacje, niekiedy wywołujące napięcie, innym razem śmiech. Jarosław Budnik przybliża niesamowite..."
    ["channel"]=>
    string(4) "Puls"
    ["dateStart"]=>
    string(10) "2016-05-12"
    ["length"]=>
    int(30)
  }
  ...


$parser = new EpgParser();
$data = $parser->loadDay(date('Y-m-d'),'TVN 7');
if($data){
    $programs = $parser->parseDaySchedule($data,true);//second parameter set to true
}


$parser = new EpgParser();
$page = $parser->getProgramInfo("http://www.teleman.pl/tv/Rajska-Jablon-783885");
var_dump($p->parseProgramData($page));