Metadata
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?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";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user