Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance
Java decentralizedintranet-searchintranet-search-enginep2pp2p-networkprivacyprivacy-protectionsearch-enginesearchenginewebweb-search-enginewebsearchwebseearch-engine
*) peer profile can now be displayed as vcard e.g. http://localhost:8080/ViewProfile.vcf?hash=localhash
theli81b4598487a2
diff --git a/htroot/ViewProfile.html b/htroot/ViewProfile.htmlindex 9be76ffe2..de84fce21 100644--- a/htroot/ViewProfile.html+++ b/htroot/ViewProfile.html@@ -2,6 +2,7 @@<html xmlns="http://www.w3.org/1999/xhtml"><head><title>YaCy '#[clientname]#': Remote Peer Profile</title>+ <link rel="alternate" type="text/x-vcard" title="vCard" href="ViewProfile.vcf?hash=#[hash]#" />#%env/templates/metas.template%#</head><body id="ViewProfile">diff --git a/htroot/ViewProfile.java b/htroot/ViewProfile.javaindex 1dab0f7e2..3f9d01ad3 100644--- a/htroot/ViewProfile.java+++ b/htroot/ViewProfile.java@@ -57,6 +57,7 @@ import java.util.Properties;import de.anomic.data.wikiCode;import de.anomic.http.httpHeader;+import de.anomic.kelondro.kelondroBase64Order;import de.anomic.plasma.plasmaSwitchboard;import de.anomic.server.serverObjects;import de.anomic.server.serverSwitch;@@ -83,6 +84,7 @@ public class ViewProfile {prop.put("success","0");return prop;}+ prop.put("hash",hash);// get the profileHashMap profile = null;@@ -101,6 +103,7 @@ public class ViewProfile {prop.put("success", "3"); // everything okprop.put("localremotepeer", 0);prop.put("success_peername", yacyCore.seedDB.mySeed.getName());+ prop.put("success_peerhash", yacyCore.seedDB.mySeed.hash);} else {// read the profile from remote peeryacySeed seed = yacyCore.seedDB.getConnected(hash);@@ -125,6 +128,7 @@ public class ViewProfile {prop.put("success", "3"); // everything ok}prop.put("success_peername", seed.getName());+ prop.put("success_peerhash", seed.hash);}prop.put("localremotepeer", 1);}@@ -146,7 +150,7 @@ public class ViewProfile {knownKeys.add("yahoo");knownKeys.add("msn");knownKeys.add("skype");- knownKeys.add("comment");+ knownKeys.add("comment");//empty valuesIterator it = knownKeys.iterator();@@ -174,6 +178,7 @@ public class ViewProfile {"success_" + key + "_value",wikiTransformer.transform(((String) entry.getValue()).replaceAll("\r", "").replaceAll("\\\\n", "\n")));+ prop.putASIS("success_" + key + "_b64value",kelondroBase64Order.standardCoder.encodeString((String) entry.getValue()));}else{prop.put("success_" + key + "_value", value); //put replaces HTML Chars by entities.}diff --git a/htroot/ViewProfile.vcf b/htroot/ViewProfile.vcfnew file mode 100644index 000000000..d6436194e--- /dev/null+++ b/htroot/ViewProfile.vcf@@ -0,0 +1,15 @@+#(success)#::::::BEGIN:vcard+VERSION:3.0+CATEGORIES:YACY PEER+UID:#[peerhash]#+FN: #(name)#::#[value]##(/name)#+NICKNAME: #(nickname)#::#[value]# #(/nickname)#+URL: #(homepage)#::#[value]# #(/homepage)#+EMAIL: #(email)#::#[value]# #(/email)#+NOTE;CHARSET=UTF-8;ENCODING=BASE64: #(comment)#::#[b64value]# #(/comment)#+X-ICQ: #(icq)#::#[value]# #(/icq)#+X-JABBER: #(jabber)#::#[value]# #(/jabber)#+X-YAHOO: #(yahoo)#::#[value]# #(/yahoo)#+X-MSN: #(msn)#::#[value]# #(/msn)#+#{other}#X-#[key]#:#[value]##{/other}#+END:vcard#(/success)#\ No newline at end of filediff --git a/source/de/anomic/http/httpdFileHandler.java b/source/de/anomic/http/httpdFileHandler.javaindex 5a40b6f75..8707bef0e 100644--- a/source/de/anomic/http/httpdFileHandler.java+++ b/source/de/anomic/http/httpdFileHandler.java@@ -592,6 +592,7 @@ public final class httpdFileHandler extends httpdAbstractHandler implements httppath.endsWith("csv") ||path.endsWith("pac") ||path.endsWith("src") ||+ path.endsWith("vcf") ||path.endsWith("/") ||path.equals("/robots.txt")) {