*) added RSS-Feed for blog

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3413 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
hydrox 18 years ago
parent a107961099
commit e92e8b2ae3

@ -3,6 +3,7 @@
<head>
<title>YaCy '#[clientname]#': Blog</title>
#%env/templates/metas.template%#
<link rel="alternate" type="application/rss+xml" title="RSS" href="Blog.rss" />
</head>
<body id="Blog">
#%env/templates/header.template%#

@ -241,6 +241,9 @@ public class Blog {
// show blog-entry/entries
prop.put("mode", 0); //viewing
if(pagename.equals("blog_default")) {
prop.put("peername", yacyCore.seedDB.mySeed.getName());
String address = yacyCore.seedDB.mySeed.getAddress();
prop.put("address", address);
//index all entries
try {
Iterator i = switchboard.blogDB.keys(false);
@ -262,6 +265,7 @@ public class Blog {
continue;
entry = switchboard.blogDB.read(pageid);
prop.put("mode_entries_"+count+"_pageid",entry.key());
prop.put("mode_entries_"+count+"_address", address);
if(!xml) {
prop.put("mode_entries_"+count+"_subject", new String(entry.subject(),"UTF-8"));
prop.put("mode_entries_"+count+"_author", new String(entry.author(),"UTF-8"));
@ -284,6 +288,8 @@ public class Blog {
prop.put("mode_entries_"+count+"_commentsactive", 1);
prop.put("mode_entries_"+count+"_commentsactive_pageid",entry.key());
prop.put("mode_entries_"+count+"_commentsactive_comments", new String(entry.commentsSize(),"UTF-8"));
prop.put("mode_entries_"+count+"_commentsactive_address", address);
}
else prop.put("mode_entries_"+count+"_commentsactive", 0);

@ -0,0 +1,17 @@
<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>YaCy-Blog of Peer #[peername]#</title>
<link>http://#[address]#/Blog.html</link>
#(mode)# #{entries}#<item>
<author>#[author]#</author>
<title>#[subject]#</title>
<link>http://#[address]#/Blog.html?page=#[pageid]#</link>
<pubDate>#[date]#</pubDate>
<guid>#[pageid]#</guid>
<description><![CDATA[
#[page]#]]></description>
#(commentsactive)#::<comments>http://#[address]#/BlogComments.html?page=#[pageid]#</comments>#(/commentsactive)#
</item>#{/entries}# #(/mode)#
</channel>
</rss>
Loading…
Cancel
Save