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

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5416 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent e004da48d3
commit 78c568331e

@ -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;

@ -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";

Loading…
Cancel
Save