-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
27 lines (25 loc) · 930 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?
error_reporting(E_ERROR | E_PARSE);
header('Content-type: application/rss+xml');
$feed = implode(file($_GET['feed']));
$xml = simplexml_load_string($feed);
$json = json_encode($xml);
$array = json_decode($json,TRUE);
echo "<?xml version=\"1.0\"?>\r\n";
?>
<rss version="2.0">
<channel>
<?
echo "\t<title>" . htmlspecialchars($array['channel']['title']) . "</title>\r\n";
echo "\t<link>" . htmlspecialchars($array['channel']['link']) . "</link>\r\n";
echo "\t<description>" . htmlspecialchars($array['channel']['description']) . "</description>\r\n";
foreach ( $array['channel']['item'] as $item ) {
echo "\t<item>\r\n";
echo "\t\t<title>" . htmlspecialchars($item['title']) . "</title>\r\n";
echo "\t\t<link>" . htmlspecialchars($item['link']) . "</link>\r\n";
echo "\t\t<pubDate>" . htmlspecialchars($item['pubDate']) . "</pubDate>\r\n";
echo "\t</item>\r\n";
}
?>
</channel>
</rss>