forked from dg/rss-php
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathload-rss.php
More file actions
27 lines (19 loc) · 782 Bytes
/
load-rss.php
File metadata and controls
27 lines (19 loc) · 782 Bytes
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
<?php
header('Content-Type: text/html; charset=utf-8');
if (!ini_get('date.timezone')) {
date_default_timezone_set('Europe/Prague');
}
require_once 'feed.class.php';
$rss = Feed::loadRss('http://phpfashion.com/feed/rss');
?>
<h1><?php echo htmlSpecialChars($rss->title)?></h1>
<p><i><?php echo htmlSpecialChars($rss->description)?></i></p>
<?php foreach ($rss->item as $item): ?>
<h2><a href="<?php echo htmlSpecialChars($item->link)?>"><?php echo htmlSpecialChars($item->title)?></a>
<small><?php echo date("j.n.Y H:i", (int) $item->timestamp)?></small></h2>
<?php if (isset($item->{'content:encoded'})):?>
<div><?php echo $item->{'content:encoded'} ?></div>
<?php else:?>
<p><?php echo htmlSpecialChars($item->description)?></p>
<?php endif?>
<?php endforeach?>