Esempio n. 1
0
<?php

include "../include/json.php";
$rawdata = "./astra.tv.json";
if (!file_exists($rawdata)) {
    $rawjson = file_get_contents("http://www.astra.de/webservice/v3/channels" . "?limit=9999&page=1&sort_by=name&sort_direction=asc" . "&domain_identifier=d3d3LmFzdHJhLmRl&free=yes&pay=yes&mode=tv");
    $json = json_decdat($rawjson);
    file_put_contents($rawdata, json_encdat($json));
}
Esempio n. 2
0
function readServices($servicesdir, $networkname)
{
    if (!isset($GLOBALS["services"])) {
        $GLOBALS["services"] = array();
    }
    $dfd = opendir($servicesdir);
    while (($entry = readdir($dfd)) !== false) {
        if ($entry == ".") {
            continue;
        }
        if ($entry == "..") {
            continue;
        }
        $jsondata = file_get_contents($servicesdir . "/" . $entry);
        $json = json_decdat($jsondata);
        $json["networkname"] = $networkname;
        $GLOBALS["services"][$entry] = $json;
    }
    closedir($dfd);
}