*) adding image tag into rss template

*) adding a xslt stylesheet so that the rss document can be viewed in a normal webbrowser
*) adding pubDate tag to each search item

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@173 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
theli 2005-05-25 08:47:34 +00:00
parent 6f09251bbc
commit 74eb21f62e
5 changed files with 35 additions and 18 deletions

View File

@ -244,6 +244,12 @@ public class index {
// return rewrite properties
prop.put("promoteSearchPageGreeting", env.getConfig("promoteSearchPageGreeting", ""));
// adding some additional properties needed for the rss feed
String hostName = (String) header.get("Host","localhost");
if (hostName.indexOf(":") == -1) hostName += ":" + env.getConfig("port","8080");
prop.put("rssYacyImageURL","http://" + hostName + "/env/grafics/yacy.gif");
return prop;
}

View File

@ -1,12 +1,18 @@
<?xml version="1.0"?>
<?xml-stylesheet type='text/xsl' href='/index.xsl' version='1.0'?>
<rss version="2.0" xmlns:yacyTopwords="http://www.yacy.net/yacy/topwords">
<channel>
<title>Search for #[former]#</title>
<description>Search for #[former]#</description>
<image>
<url>#[rssYacyImageURL]#</url>
<title>Search for #[former]#</title>
</image>
#{results}#
<item>
<title>#[description]#</title>
<link>#[url]#</link>
<pubDate>#[date]#</pubDate>
</item>
#{/results}#
<yacyTopwords:topwords>

View File

@ -73,6 +73,7 @@ wav = audio/x-wav
xhtml = application/xhtml+xml
xla = application/msexcel
xls = application/msexcel
xsl = application/xml
xml = application/xml
Z = application/x-compress
zip = application/zip

View File

@ -113,6 +113,9 @@ implements Parser {
mimeType = match.getMimeType();
}
// to avoid loops we have to test if the mimetype has changed ...
if (this.getSupportedMimeTypes().containsKey(mimeType)) return null;
plasmaParser theParser = new plasmaParser();
return theParser.parseSource(location,mimeType,sourceFile);
}

View File

@ -1104,6 +1104,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
prop.put("results_" + i + "_url", urlstring);
prop.put("results_" + i + "_urlname", urlname);
prop.put("results_" + i + "_date", dateString(urlentry.moddate()));
prop.put("results_" + i + "_size", Long.toString(urlentry.size()));
i++;
}
}