[insert_php]
$rss = new DOMDocument();
$rss->load(‘https://diavgeia.gov.gr/luminapi/api/feed/rss?q=organizationId:%22%CE%94%CE%97%CE%9C%CE%9F%CE%A3%20%CE%91%CE%9C%CE%A6%CE%99%CE%A0%CE%9F%CE%9B%CE%97%CE%A3%22’);
$feed = array();
foreach ($rss->getElementsByTagName(‘item’) as $node) {
$item = array (
‘title’ => $node->getElementsByTagName(‘title’)->item(0)->nodeValue,
‘desc’ => $node->getElementsByTagName(‘description’)->item(0)->nodeValue,
‘link’ => $node->getElementsByTagName(‘link’)->item(0)->nodeValue,
‘author’ => $node->getElementsByTagName(‘author’)->item(0)->nodeValue,
);
array_push($feed, $item);
}
$limit = 5;
for($x=0;$x<$limit;$x++) {
$title = str_replace(' & ', ' & ', $feed[$x]['title']);
$link = $feed[$x]['link'];
$description = $feed[$x]['desc'];
$author = $feed[$x]['author'];
echo '
‘.$title.’
‘;
echo ‘Posted by ‘.$author.’
‘;
echo ‘
‘.$description.’
‘;
}
[/insert_php]