forked from dg/rss-php
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathload-atom.php
More file actions
26 lines (18 loc) · 722 Bytes
/
load-atom.php
File metadata and controls
26 lines (18 loc) · 722 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
<?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';
$atom = Feed::loadAtom('http://phpfashion.com/feed/atom');
?>
<h1><?php echo htmlSpecialChars($atom->title)?></h1>
<?php foreach ($atom->entry as $entry): ?>
<h2><a href="<?php echo htmlSpecialChars($entry->link['href'])?>"><?php echo htmlSpecialChars($entry->title)?></a>
<small><?php echo date("j.n.Y H:i", (int) $entry->timestamp)?></small></h2>
<?php if ($entry->content['type'] == 'html'):?>
<div><?php echo $entry->content?></div>
<?php else:?>
<p><?php echo htmlSpecialChars($entry->content)?></p>
<?php endif?>
<?php endforeach?>