Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

added test channel to /xml/feed.rss can be obtained with http://localhost:8080/xml/feed.rss?set=TEST returns always a single feed entry with a fresh date

orbiter78c568331e22
diff --git a/htroot/xml/feed.java b/htroot/xml/feed.java
index 48490c548..0e33475aa 100755
--- a/htroot/xml/feed.java
+++ b/htroot/xml/feed.java
@@ -26,6 +26,8 @@
package xml;
+import java.util.Date;
+
import de.anomic.http.httpRequestHeader;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.server.serverObjects;
@@ -60,6 +62,21 @@ public class feed {
// prevent that unauthorized access to this servlet get results from private data
if ((!authorized) && (RSSFeed.privateChannels.contains(channels[channelIndex]))) continue channelIteration; // allow only public channels if not authorized
+ if (channels[channelIndex].equals("TEST")) {
+ // for interface testing return at least one single result
+ prop.putXML("channel_title", "YaCy News Testchannel");
+ prop.putXML("channel_description", "");
+ prop.put("channel_pubDate", (new Date()).toString());
+ prop.putXML("item_" + messageCount + "_title", channels[channelIndex] + ": " + "YaCy Test Entry " + (new Date()).toString());
+ prop.putXML("item_" + messageCount + "_description", "abcdefg");
+ prop.putXML("item_" + messageCount + "_link", "http://yacy.net");
+ prop.put("item_" + messageCount + "_pubDate", (new Date()).toString());
+ prop.put("item_" + messageCount + "_guid", System.currentTimeMillis());
+ messageCount++;
+ messageMaxCount--;
+ continue channelIteration;
+ }
+
// read the channel
feed = RSSFeed.channels(channels[channelIndex]);
if ((feed == null) || (feed.size() == 0)) continue channelIteration;
diff --git a/source/de/anomic/xml/RSSFeed.java b/source/de/anomic/xml/RSSFeed.java
index 7c1ac2808..14d4f2128 100644
--- a/source/de/anomic/xml/RSSFeed.java
+++ b/source/de/anomic/xml/RSSFeed.java
@@ -34,6 +34,7 @@ import java.util.concurrent.ConcurrentLinkedQueue;
public class RSSFeed implements Iterable<RSSMessage> {
// static channel names of feeds
+ public static final String TEST = "TEST";
public static final String PEERNEWS = "PEERNEWS";
public static final String REMOTESEARCH = "REMOTESEARCH";
public static final String LOCALSEARCH = "LOCALSEARCH";