[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Debian JP master SVN www commits (rev.122)
=======================================================
Repository: /org/svn.debian.or.jp/repos
Revision: 122
Commiter: kmuto
Date: 2007-01-05 01:54:01 +0900 (金, 05 1月 2007)
=======================================================
Log:
blosxom and rss file
=======================================================
Changed:
A www/trunk/blosxom/data/flavours/foot.rss
A www/trunk/blosxom/data/flavours/head.rss
A www/trunk/blosxom/data/flavours/story.rss
A www/trunk/blosxom/plugins/rss10
U www/trunk/include/config
U www/trunk/progs/fetch-dsa
U www/trunk/src/index.tt2
Added: www/trunk/blosxom/data/flavours/foot.rss
===================================================================
--- www/trunk/blosxom/data/flavours/foot.rss 2007-01-04 15:46:55 UTC (rev 121)
+++ www/trunk/blosxom/data/flavours/foot.rss 2007-01-04 16:54:01 UTC (rev 122)
@@ -0,0 +1 @@
+</rdf:RDF>
Added: www/trunk/blosxom/data/flavours/head.rss
===================================================================
--- www/trunk/blosxom/data/flavours/head.rss 2007-01-04 15:46:55 UTC (rev 121)
+++ www/trunk/blosxom/data/flavours/head.rss 2007-01-04 16:54:01 UTC (rev 122)
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="EUC-JP"?>
+<rdf:RDF
+ xmlns="http://purl.org/rss/1.0/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:admin="http://webns.net/mvcb/"
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
+ xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/"
+ xml:lang="$blog_language">
+ <channel rdf:about="$url/index.rss">
+ <title>$blog_title</title>
+ <link>$url</link>
+ <description>$blog_description</description>
+{{{items}}}
+ </channel>
Added: www/trunk/blosxom/data/flavours/story.rss
===================================================================
--- www/trunk/blosxom/data/flavours/story.rss 2007-01-04 15:46:55 UTC (rev 121)
+++ www/trunk/blosxom/data/flavours/story.rss 2007-01-04 16:54:01 UTC (rev 122)
@@ -0,0 +1,8 @@
+ <item rdf:about="$url$path/$fn.html">
+ <title>$rss10::title</title>
+ <link>$url$path/$fn.html</link>
+ <description>$rss10::description</description>
+ <dc:subject>$categories::alias</dc:subject>
+ <dc:date>$yr-$mo_num-$da$rss10::T$ti$rss10::tz_offset</dc:date>
+ <content:encoded><![CDATA[$body]]></content:encoded>
+ </item>
Added: www/trunk/blosxom/plugins/rss10
===================================================================
--- www/trunk/blosxom/plugins/rss10 2007-01-04 15:46:55 UTC (rev 121)
+++ www/trunk/blosxom/plugins/rss10 2007-01-04 16:54:01 UTC (rev 122)
@@ -0,0 +1,126 @@
+# Blosxom Plugin: rss10
+# Author(s): Rael Dornfest <rael@xxxxxxxxxxx>
+# Version: 2.0b4
+# Blosxom Home/Docs/Licensing: http://www.blosxom.com/
+
+package rss10;
+
+# --- Configurable variables -----------
+
+# --- Plug-in package variables --------
+
+my $template_placeholder = "{{{items}}}";
+$items;
+$title;
+$description;
+$content_encoded;
+
+$generatorAgent = "http://www.blosxom.com/?v=$blosxom::version";
+$T = 'T';
+$colon = ":";
+
+# --------------------------------------
+
+sub start {
+ 1;
+}
+
+sub head {
+ $items = '';
+}
+
+sub story {
+ my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_;
+
+ $title = &strip_html($$title_ref);
+ $description = &strip_html($$body_ref);
+ $items .= qq{\t\t\t\t<rdf:li rdf:resource="$blosxom::url$path/$filename.htm"/>\n};
+
+ 1;
+}
+
+sub foot {
+ my($pkg, $currentdir, $foot_ref) = @_;
+
+ chomp($items);
+ $items = <<"ITEMS";
+ <items>
+ <rdf:Seq>
+$items
+ </rdf:Seq>
+ </items>
+ITEMS
+ chomp($items);
+ $blosxom::output =~ s/$template_placeholder/$items/m;
+
+ return 1;
+}
+
+sub strip_html {
+ my $str = shift;
+
+ $str =~ s!\x0D|\x0A!!g;
+ $str =~ s!<.*?>!!g;
+
+ return $str;
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+Blosxom Plug-in: rss10
+
+=head1 SYNOPSIS
+
+Purpose: Provides the extra bit of programming needed to produce a valid
+RSS 1.0 [http://www.purl.org/rss/1.0/] feed for syndication. Works
+in concert with the associated {head,story,foot,content_type,date}.rss10
+flavour files.
+
+=head1 VERSION
+
+2.0b1
+
+Version number coincides with the version of Blosxom with which the
+current version was first bundled.
+
+=head1 AUTHOR
+
+Rael Dornfest <rael@xxxxxxxxxxx>, http://www.raelity.org/
+
+=head1 SEE ALSO
+
+Blosxom Home/Docs/Licensing: http://www.raelity.org/apps/blosxom/
+
+Blosxom Plugin Docs: http://www.raelity.org/apps/blosxom/plugin.shtml
+
+=head1 BUGS
+
+Address bug reports and comments to the Blosxom mailing list
+[http://www.yahoogroups.com/group/blosxom].
+
+=head1 LICENSE
+
+Blosxom and this Blosxom Plug-in
+Copyright 2003, Rael Dornfest
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
Modified: www/trunk/include/config
===================================================================
--- www/trunk/include/config 2007-01-04 15:46:55 UTC (rev 121)
+++ www/trunk/include/config 2007-01-04 16:54:01 UTC (rev 122)
@@ -6,6 +6,7 @@
wwworg = 'http://www.jp.debian.org';
dsafile = '/tmp/www.debian.or.jp/dsa.ja.euc-jp';
+ newsfile = '/tmp/www.debian.or.jp/news.rss';
jnews = [
{ url => 'blog/', title => '最近の話題' }
Modified: www/trunk/progs/fetch-dsa
===================================================================
--- www/trunk/progs/fetch-dsa 2007-01-04 15:46:55 UTC (rev 121)
+++ www/trunk/progs/fetch-dsa 2007-01-04 16:54:01 UTC (rev 122)
@@ -1,6 +1,7 @@
#!/bin/sh
LANG=C
export LANG
+UPDATE=
if [ $# = 0 -a "$(whoami)" != "wwwadm" ]; then
sudo -u wwwadm -H $0
@@ -15,6 +16,16 @@
if [ -z "$(wget -m http://www.debian.org/security/dsa.ja 2>&1 | grep ' 0 files')" ]; then
# updated
nkf -e www.debian.org/security/dsa.ja | sed -e "s/iso\-2022\-jp/x-euc-jp-unicode/" > dsa.ja.euc-jp
+ UPDATE=yes
+fi
+
+if [ -z "$(wget -m http://osdn2.debian.or.jp/blog/index.cgi/index.rss\?recache=all 2>&1 | grep ' 0 files')" ]; then
+ sed -e "s/EUC-JP/x-euc-jp-unicode/" -e "s/index.cgi\///g" < osdn2.debian.or.jp/blog/index.cgi/index.rss\?recache=all > news.rss
+ # updated
+ UPDATE=yes
+fi
+
+if [ "$UPDATE" ]; then
cd $P
ttree index.tt2
fi
Modified: www/trunk/src/index.tt2
===================================================================
--- www/trunk/src/index.tt2 2007-01-04 15:46:55 UTC (rev 121)
+++ www/trunk/src/index.tt2 2007-01-04 16:54:01 UTC (rev 122)
@@ -8,8 +8,15 @@
<h2>最近の話題</h2>
<ul>
+[% USE news = XML.RSS(newsfile) %]
+[% FOREACH item = news.items %]
+ <li>
+<a href="[% item.link %]">[% item.title FILTER iconv("utf-8", "euc-jp") %]</a> <br />([% item.dc.date.replace('-', '/').replace('T', ' ') %])
+ </li>
+[% LAST IF loop.count > 9 %]
+[% END %]
</ul>
- <p style="text-align: right;"><a href="http://blog.debian.or.jp/">»(もっと過去の話題を見る)</a>
+ <p style="text-align: right;"><a href="blog/">»(もっと過去の話題を見る)</a>
</p>
</div>