From 5f80b72cac036024b5245f7c32b272827b1fee9d Mon Sep 17 00:00:00 2001
From: "(no author)" <(no author)@6c8d7289-2bf4-0310-a012-ef5d649a1542>
Date: Thu, 31 May 2007 14:22:27 +0000
Subject: [PATCH] *) adding peer-hash, seed-url and location to network.xml

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3772 6c8d7289-2bf4-0310-a012-ef5d649a1542
---
 htroot/Network.java | 8 ++++++++
 htroot/Network.xml  | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/htroot/Network.java b/htroot/Network.java
index 420e6e9db..9b238b230 100644
--- a/htroot/Network.java
+++ b/htroot/Network.java
@@ -116,6 +116,7 @@ public class Network {
 
                 // my-info
                 prop.put("table_my-name", seed.get(yacySeed.NAME, "-") );
+                prop.put("table_my-hash", seed.hash );
                 if (yacyCore.seedDB.mySeed.isVirgin()) {
                     prop.put("table_my-info", 0);
                 } else if(yacyCore.seedDB.mySeed.isJunior()) {
@@ -153,6 +154,13 @@ public class Network {
                 prop.put("table_my-totalqph", Double.toString(Math.round(6000d * sb.totalQPM) / 100d));
                 prop.put("table_my-seeds", seed.get(yacySeed.SCOUNT, "-"));
                 prop.put("table_my-connects", groupDigits(seed.get(yacySeed.CCOUNT, "0")));
+                prop.put("table_my-url", seed.get("seedURL", ""));
+                
+                // generating the location string
+                String location = httpc.userAgent;
+                int p = location.lastIndexOf(';');
+                location = (p > 0) ? location.substring(p + 1, location.length() - 1).trim(): "";
+                prop.put("table_my-location", location);
             }
 
             // overall results: Network statistics
diff --git a/htroot/Network.xml b/htroot/Network.xml
index 60506c736..eb244c310 100644
--- a/htroot/Network.xml
+++ b/htroot/Network.xml
@@ -58,6 +58,7 @@
   </all>
   <your>
         <name>#[my-name]#</name>
+        <hash>#[my-hash]#</hash>
         <type>#(my-info)#virgin::junior::senior::principal#(/my-info)#</type>
         <version>#[my-version]#</version>
         <utc>#[my-utc]#</utc>
@@ -74,6 +75,8 @@
 		<qph>#[my-qph]#</qph>
         <seeds>#[my-seeds]#</seeds>
         <connects>#[my-connects]#</connects>
+    	<location>#[my-location]#</location>
+    	<seedurl>#[my-url]#</seedurl>
   </your>
   <cluster>
   	<ppm>#[gppm]#</ppm>