Skip to content

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

added new news types

orbiter684ded0e0944
diff --git a/build.properties b/build.properties
index 9e9862410..1a11630d7 100644
--- a/build.properties
+++ b/build.properties
@@ -3,7 +3,7 @@ javacSource=1.4
javacTarget=1.4
# Release Configuration
-releaseVersion=0.523
+releaseVersion=0.524
releaseFile=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
#releaseFile=yacy_v${releaseVersion}_${DSTAMP}_${releaseNr}.tar.gz
releaseDir=yacy_dev_v${releaseVersion}_${DSTAMP}_${releaseNr}
diff --git a/source/de/anomic/plasma/plasmaSwitchboard.java b/source/de/anomic/plasma/plasmaSwitchboard.java
index 8cf28d619..ef76d7b55 100644
--- a/source/de/anomic/plasma/plasmaSwitchboard.java
+++ b/source/de/anomic/plasma/plasmaSwitchboard.java
@@ -104,6 +104,7 @@
package de.anomic.plasma;
import java.io.File;
+import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
@@ -117,6 +118,7 @@ import java.util.HashMap;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.Map;
+import java.util.Properties;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
@@ -164,6 +166,7 @@ import de.anomic.tools.crypt;
import de.anomic.yacy.yacyClient;
import de.anomic.yacy.yacyCore;
import de.anomic.yacy.yacyNewsPool;
+import de.anomic.yacy.yacyNewsRecord;
import de.anomic.yacy.yacySeed;
public final class plasmaSwitchboard extends serverAbstractSwitch implements serverSwitch {
@@ -1914,6 +1917,26 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
if (yacyCore.newsPool.automaticProcess() > 0) hasDoneSomething = true;
} catch (IOException e) {}
+ // initiate broadcast about peer startup to spread supporter url
+ if (yacyCore.newsPool.size(yacyNewsPool.OUTGOING_DB) == 0) {
+ // read profile
+ final Properties profile = new Properties();
+ FileInputStream fileIn = null;
+ try {
+ fileIn = new FileInputStream(new File("DATA/SETTINGS/profile.txt"));
+ profile.load(fileIn);
+ } catch(IOException e) {
+ } finally {
+ if (fileIn != null) try { fileIn.close(); } catch (Exception e) {}
+ }
+ String homepage = (String) profile.get("homepage");
+ if ((homepage != null) && (homepage.length() > 10)) {
+ Properties news = new Properties();
+ news.put("homepage", profile.get("homepage"));
+ yacyCore.newsPool.publishMyNews(new yacyNewsRecord(yacyNewsPool.CATEGORY_PROFILE_BROADCAST, news));
+ }
+ }
+
// set a maximum amount of memory for the caches
long memprereq = Math.max(getConfigLong(INDEXER_MEMPREREQ, 0), wordIndex.minMem());
// setConfig(INDEXER_MEMPREREQ, memprereq);
diff --git a/source/de/anomic/yacy/yacyNewsPool.java b/source/de/anomic/yacy/yacyNewsPool.java
index 2ab651690..f0b258521 100644
--- a/source/de/anomic/yacy/yacyNewsPool.java
+++ b/source/de/anomic/yacy/yacyNewsPool.java
@@ -71,6 +71,19 @@ public class yacyNewsPool {
* a profile entry was updated (implemented)
*/
public static final String CATEGORY_PROFILE_UPDATE = "prfleupd";
+ /**
+ * a peer starts up and renews its profile broadcast; used to implement supporter page
+ */
+ public static final String CATEGORY_PROFILE_BROADCAST = "prflecst";
+ /**
+ * a peer has done something good (i.e. served good search results)
+ * and gets a positive vote so it can rise on the supporter page
+ */
+ public static final String CATEGORY_PROFILE_VOTE_GOOD = "prflegvt";
+ /**
+ * a peer has done something bad (i.e. spammed) and gets a negative vote
+ */
+ public static final String CATEGORY_PROFILE_VOTE_BAD = "prflebvt";
/* ------------------------------------------------------------------------
* CRAWLING related CATEGORIES
@@ -201,6 +214,9 @@ public class yacyNewsPool {
public static final String[] category = {
// PROFILE related CATEGORIES
CATEGORY_PROFILE_UPDATE,
+ CATEGORY_PROFILE_BROADCAST,
+ CATEGORY_PROFILE_VOTE_GOOD,
+ CATEGORY_PROFILE_VOTE_BAD,
// CRAWLING related CATEGORIES
CATEGORY_CRAWL_START,