Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
*) adding RSS feed for peer messages
theli0d178d00a567
diff --git a/htroot/Messages_p.html b/htroot/Messages_p.htmlindex 70805390a..88c2e2166 100644--- a/htroot/Messages_p.html+++ b/htroot/Messages_p.html@@ -2,6 +2,7 @@<html xmlns="http://www.w3.org/1999/xhtml"><head><title>YaCy '#[clientname]#': Messages</title>+ <link rel="alternate" type="application/rss+xml" title="RSS" href="Messages_p.rss" />#%env/templates/metas.template%#</head><body id="Messages">diff --git a/htroot/Messages_p.java b/htroot/Messages_p.javaindex 5644bc192..79f115bea 100644--- a/htroot/Messages_p.java+++ b/htroot/Messages_p.java@@ -75,6 +75,11 @@ public class Messages_p {plasmaSwitchboard switchboard = (plasmaSwitchboard) env;serverObjects prop = new serverObjects();+ // set peer address / name+ final String peerAddress = yacyCore.seedDB.mySeed.getAddress();+ final String peerName = yacyCore.seedDB.mySeed.getName();+ prop.put("peerAddress", peerAddress);+ prop.put("peerName", peerName);// List known hosts for message sending (from Blacklist_p.java)if (yacyCore.seedDB != null && yacyCore.seedDB.sizeConnected() > 0) {@@ -143,6 +148,17 @@ public class Messages_p {prop.put("mode_messages_"+count+"_subject", wikiCode.replaceHTML(message.subject()));prop.put("mode_messages_"+count+"_key", key);prop.put("mode_messages_"+count+"_hash", message.authorHash());++ // also write out the message body (needed for the RSS feed)+ if (((String)header.get(httpHeader.CONNECTION_PROP_PATH)).endsWith(".rss")) {+ prop.put("mode_messages_"+count+"_peerAddress", peerAddress);+ try {+ prop.put("mode_messages_"+count+"_body",new String(message.message(), "UTF-8"));+ } catch (UnsupportedEncodingException e) {+ // can not happen, because UTF-8 must be supported by every JVM+ }+ }+dark = !dark;count++;}diff --git a/htroot/Messages_p.rss b/htroot/Messages_p.rssnew file mode 100644index 000000000..b8182e328--- /dev/null+++ b/htroot/Messages_p.rss@@ -0,0 +1,24 @@+<?xml version="1.0"?>+<rss version="2.0">+<channel>+ <title><![CDATA[YaCy '#[peerName]#': Messages]]></title>+ <link>http://#[peerAddress]#/Messages_p.html</link>+ <image>+ <url>http://#[peerAddress]#/env/grafics/yacy.png</url>+ <title>YaCy</title>+ <link>http://#[peerAddress]#/</link>+ </image>+#(mode)#+#{messages}#+ <item>+ <author><![CDATA[#[from]#]]></author>+ <title><![CDATA[#[subject]#]]></title>+ <link>http://#[peerAddress]#/Messages_p.html?action=view&object=#[key]#</link>+ <pubDate>#[date]#</pubDate>+ <guid>#[key]#</guid>+ <description><![CDATA[#[body]#]]></description>+ </item>+#{/messages}#+::#(/mode)#+</channel>+</rss>\ No newline at end of file