forked from singpolyma/xoxotools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeed2hatom.php
executable file
·26 lines (20 loc) · 933 Bytes
/
feed2hatom.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
<?php
if(!$_GET['url']) {
?>
Turns a feed into <a href="http://blogxoxo.blogspot.com/2006/01/xoxo-blog-format.html">XOXO Blog Format</a> - compatible <a href="http://microformats.org/wiki/hatom">hAtom</a>
<form method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>"><div>
<input type="hidden" name="xn_auth" value="no" />
Feed URL: <input type="text" name="url" value="" />
<input type="submit" value="Go" />
</div></form>
<?php
exit;
}//end if ! url
header('Content-Type: application/xml; charset=utf-8');
require_once 'feed2hatom.inc.php';
require_once 'OutlineClasses/Outline.php';
$outline = new Outline(feed2hatom($_GET['url']));
$outline->fieldsFromFirstNode(array());
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'."\n";
echo $outline->toXOXO(array('xoxo','posts','hfeed'),true,array('hentry'));
?>