-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfeed.xml
80 lines (54 loc) · 2.21 KB
/
feed.xml
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?
include($_SERVER['DOCUMENT_ROOT']."/constants.php");
function get_dir_contents($web_directory) {
$directory = $_SERVER['DOCUMENT_ROOT'].$web_directory;
if(file_exists($directory)) {
$myDirectory = opendir($directory);
while($entryName = readdir($myDirectory)) {
if (substr($entryName, 0, 1) != "."){
$dirArray[] = $entryName;
}
}
sort($dirArray, SORT_NUMERIC);
return $dirArray;
}
}
$systemfiles = array("index.php", "indexcontents.php", "constants.php", "contents.php", "feed.php", "footer.php", "disqus.php");
$files = get_dir_contents("/");
$feedarray = array();
foreach ($files as $filename) {
$ext = pathinfo($filename, PATHINFO_EXTENSION);
if ($ext == "php" && !in_array($filename, $systemfiles)) {
$feedarray[$filename] = filemtime($filename);
}
}
arsort($feedarray);
foreach ($feedarray as $page => $modified) {
$mostrecent = $modified;
break;
}
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?> <?xml-stylesheet type=\"text/xsl\" href=\"/atom2html.xslt\"?> <feed xmlns=\"http://www.w3.org/2005/Atom\">";
?>
<title>CSS3 Transitions, Transforms and Animations</title>
<subtitle>Examples and practical uses by Rich Bradshaw</subtitle>
<link href="http://css3.bradshawenterprises.com/feed.php" rel="self" />
<link href="http://css3.bradshawenterprises.com/" />
<id>tag:css3.bradshawenterprises.com,2012-02-12:/20120212161845979</id>
<updated><?= date(DATE_ATOM, $mostrecent )?></updated>
<? foreach ($feedarray as $page => $modified) {
$realpage = str_replace(".php","",$page);
$linktopage = "http://css3.bradshawenterprises.com/".$realpage."/";
?>
<entry>
<author>
<name>Rich Bradshaw</name>
</author>
<title type="html"><![CDATA[Updated: <?= $titles[$realpage] ?>]]></title>
<link rel="alternate" type="text/html" href="<?= $linktopage ?>" />
<id>tag:css3.bradshawenterprises.com,2012:</id>
<updated><?= date(DATE_ATOM, $modified) ?></updated>
<published><?= date(DATE_ATOM, $modified) ?></published>
<content type="html"><![CDATA[I've just updated the content on my CSS3 transitions, transforms and animations page. Have a look at the page that's changed/been added <a href="<?= $linktopage ?>">here</a>.]]></content>
</entry>
<? } ?>
</feed>