Files
TVGuide/app/bin/rytec-list-sources.php
2026-07-07 15:54:11 +02:00

32 lines
767 B
PHP

<?php
$url = 'https://raw.githubusercontent.com/doglover3920/EPGimport-Sources/main/rytec.sources.xml';
$xmlText = file_get_contents($url);
if ($xmlText === false) {
fwrite(STDERR, "Konnte rytec.sources.xml nicht laden.\n");
exit(1);
}
$xml = simplexml_load_string($xmlText);
if (!$xml) {
fwrite(STDERR, "Konnte rytec.sources.xml nicht lesen.\n");
exit(1);
}
foreach ($xml->xpath('//sourcecat') as $cat) {
$catName = (string)$cat['sourcecatname'];
echo "\n=== {$catName} ===\n";
foreach ($cat->source as $source) {
$description = trim((string)$source->description);
echo "- {$description}\n";
foreach ($source->url as $sourceUrl) {
echo " " . trim((string)$sourceUrl) . "\n";
}
}
}