1 |
panda |
1.1 |
<?php |
2 |
|
|
///////////////////////////////////////////////// |
3 |
|
|
// PukiWiki - Yet another WikiWikiWeb clone. |
4 |
|
|
// |
5 |
arino |
1.4 |
// $Id: rss10.inc.php,v 1.3 2003/02/24 10:09:43 panda Exp $ |
6 |
panda |
1.1 |
// |
7 |
|
|
// RecentChanges ? RSS ???阪?? |
8 |
|
|
function plugin_rss10_action() |
9 |
|
|
{ |
10 |
panda |
1.2 |
global $script,$rss_max,$page_title,$whatsnew; |
11 |
panda |
1.1 |
|
12 |
panda |
1.3 |
$self = $script.'?'; |
13 |
arino |
1.4 |
|
14 |
|
|
$page_title_utf8 = mb_convert_encoding($page_title,'UTF-8',SOURCE_ENCODING); |
15 |
|
|
|
16 |
panda |
1.1 |
$items = $rdf_li = ''; |
17 |
arino |
1.4 |
|
18 |
|
|
if (!file_exists(CACHE_DIR.'recent.dat')) |
19 |
|
|
{ |
20 |
panda |
1.2 |
return ''; |
21 |
|
|
} |
22 |
|
|
$recent = file(CACHE_DIR.'recent.dat'); |
23 |
|
|
$lines = array_splice($recent,0,$rss_max); |
24 |
arino |
1.4 |
foreach ($lines as $line) |
25 |
|
|
{ |
26 |
panda |
1.2 |
list($time,$page) = explode("\t",rtrim($line)); |
27 |
|
|
$r_page = rawurlencode($page); |
28 |
arino |
1.4 |
$title = mb_convert_encoding($page,'UTF-8',SOURCE_ENCODING); |
29 |
panda |
1.3 |
// 'O'???阪?????????祉??'+09:00'??就???翫就 |
30 |
|
|
$dcdate = substr_replace(get_date('Y-m-d\TH:i:sO',$time),':',-2,0); |
31 |
|
|
|
32 |
|
|
// $desc = get_date('D, d M Y H:i:s T',$time); |
33 |
|
|
// <description>$desc</description> |
34 |
panda |
1.1 |
|
35 |
|
|
$items .= <<<EOD |
36 |
panda |
1.3 |
<item rdf:about="$script?$r_page"> |
37 |
panda |
1.1 |
<title>$title</title> |
38 |
panda |
1.3 |
<link>$script?$r_page</link> |
39 |
panda |
1.1 |
<dc:date>$dcdate</dc:date> |
40 |
|
|
</item> |
41 |
|
|
|
42 |
|
|
EOD; |
43 |
panda |
1.3 |
$rdf_li .= " <rdf:li rdf:resource=\"$script?$r_page\" />\n"; |
44 |
panda |
1.1 |
} |
45 |
|
|
|
46 |
|
|
header('Content-type: application/xml'); |
47 |
|
|
|
48 |
|
|
print <<<EOD |
49 |
|
|
<?xml version="1.0" encoding="utf-8"?> |
50 |
|
|
|
51 |
|
|
<rdf:RDF |
52 |
|
|
xmlns:dc="http://purl.org/dc/elements/1.1/" |
53 |
|
|
xmlns="http://purl.org/rss/1.0/" |
54 |
|
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
55 |
|
|
xml:lang="ja"> |
56 |
|
|
|
57 |
panda |
1.3 |
<channel rdf:about="$script?rss"> |
58 |
panda |
1.1 |
<title>$page_title_utf8</title> |
59 |
panda |
1.3 |
<link>$script?$whatsnew</link> |
60 |
panda |
1.1 |
<description>PukiWiki RecentChanges</description> |
61 |
|
|
<items> |
62 |
|
|
<rdf:Seq> |
63 |
|
|
$rdf_li |
64 |
|
|
</rdf:Seq> |
65 |
|
|
</items> |
66 |
|
|
</channel> |
67 |
|
|
|
68 |
|
|
$items |
69 |
|
|
</rdf:RDF> |
70 |
|
|
EOD; |
71 |
|
|
exit; |
72 |
|
|
} |
73 |
|
|
?> |