update to web structure picture:

- allow bigger size
- better instructions for api usage

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

@ -22,8 +22,11 @@
#%env/templates/header.template%# #%env/templates/header.template%#
#%env/templates/submenuWebStructure.template%# #%env/templates/submenuWebStructure.template%#
<div id="api"><a href="/api/webstructure.xml"><img src="env/grafics/api.png"></a> <div id="api"><a href="/api/webstructure.xml?about=#[besthost]#"><img src="env/grafics/api.png"></a>
<span>The data that is visualized here can also be retrieved in a XML file. The XM L contains a back-reference of domains. That means you can see the set of domains that all link to the same (other) domain, which could be called a 'reverse domain index'. <span>
The data that is visualized here can also be retrieved in a XML file, which lists the reference relation between the domains.
With a GET-property 'about' you get only reference relations about the host that you give in the argument field for 'about'.
With a GET-property 'latest' you get a list of references that had been computed during the current run-time of YaCy, and with each next call only an update to the next list of references.
Click the API icon to see the XML file. Click the API icon to see the XML file.
To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de/wiki/index.php/Dev:API">API wiki page</a>.</span> To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de/wiki/index.php/Dev:API">API wiki page</a>.</span>
</div> </div>
@ -33,7 +36,8 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
<div id="left"> <div id="left">
<form action="/WatchWebStructure_p.html"> <form action="/WatchWebStructure_p.html">
<dl> <fieldset>
<dl>
<dt>host</dt> <dt>host</dt>
<dd> <dd>
<input type="text" value="#[host]#" name="host" id="host" size="20" maxlength="80" /> <input type="text" value="#[host]#" name="host" id="host" size="20" maxlength="80" />
@ -57,14 +61,15 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
<a href="WatchWebStructure_p.html?host=#[host]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodes]#&amp;time=#[timei]#"><img src="env/grafics/plus.gif" alt="plus"/></a> <a href="WatchWebStructure_p.html?host=#[host]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodes]#&amp;time=#[timei]#"><img src="env/grafics/plus.gif" alt="plus"/></a>
</dd> </dd>
<dt>size</dt> <dt>size</dt>
<dd><input type="text" name="width" value="#[width]#" size="4" maxlength="4" />&nbsp;x&nbsp;<input type="text" name="height" value="#[height]#" size="4" maxlength="4" /></dd> <dd><input type="text" name="width" value="#[width]#" size="5" maxlength="5" />&nbsp;x&nbsp;<input type="text" name="height" value="#[height]#" size="5" maxlength="5" /></dd>
<dt>&nbsp;</dt> <dt>&nbsp;</dt>
<dd><input type="submit" value="change" /></dd> <dd><input type="submit" value="change" /></dd>
</dl> </dl>
</fieldset>
</form> </form>
</div> </div><br>
<img src="WebStructurePicture_p.png?host=#[host]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodes]#&amp;time=#[time]#" alt="WebStructurePicture"/> <img align="right" src="WebStructurePicture_p.png?host=#[besthost]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodes]#&amp;time=#[time]#" alt="WebStructurePicture"/>
#%env/templates/footer.template%# #%env/templates/footer.template%#
</body> </body>

@ -20,6 +20,7 @@ public class WatchWebStructure_p {
int nodes = 500; // maximum number of host nodes that are painted int nodes = 500; // maximum number of host nodes that are painted
int time = -1; int time = -1;
String host = "auto"; String host = "auto";
String besthost;
if (post != null) { if (post != null) {
width = post.getInt("width", 768); width = post.getInt("width", 768);
@ -49,7 +50,16 @@ public class WatchWebStructure_p {
} }
} }
// find start point
if ((host == null) || (host.length() == 0) || (host.equals("auto"))) {
// find domain with most references
besthost = sb.webStructure.hostWithMaxReferences();
} else {
besthost = host;
}
prop.putHTML("host", host); prop.putHTML("host", host);
prop.putHTML("besthost", besthost);
prop.put("depth", depth); prop.put("depth", depth);
prop.put("depthi", Math.min(8, depth + 1)); prop.put("depthi", Math.min(8, depth + 1));
prop.put("depthd", Math.max(0, depth - 1)); prop.put("depthd", Math.max(0, depth - 1));

@ -65,11 +65,11 @@ public class WebStructurePicture_p {
host = post.get("host", null); host = post.get("host", null);
} }
//too small values lead to an error, too big to huge CPU/memory consumption, resulting in possible DOS. // too small values lead to an error, too big to huge CPU/memory consumption, resulting in possible DOS.
if (width < 32 ) width = 32; if (width < 32 ) width = 32;
if (width > 1920) width = 1920; if (width > 10000) width = 10000;
if (height < 24) height = 24; if (height < 24) height = 24;
if (height > 1920) height = 1920; if (height > 10000) height = 10000;
if (depth > 8) depth = 8; if (depth > 8) depth = 8;
if (depth < 0) depth = 0; if (depth < 0) depth = 0;

@ -176,7 +176,7 @@ public class plasmaWebStructure {
private static int refstr2count(final String refs) { private static int refstr2count(final String refs) {
if ((refs == null) || (refs.length() <= 8)) return 0; if ((refs == null) || (refs.length() <= 8)) return 0;
assert (refs.length() - 8) % 10 == 0; assert (refs.length() - 8) % 10 == 0 : "refs = " + refs + ", length = " + refs.length();
return (refs.length() - 8) / 10; return (refs.length() - 8) / 10;
} }
@ -471,21 +471,20 @@ public class plasmaWebStructure {
private void next0() { private void next0() {
Map.Entry<String, String> entry = null; Map.Entry<String, String> entry = null;
String dom = null, ref; String dom = null, ref = "";
while (i.hasNext()) { while (i.hasNext()) {
entry = i.next(); entry = i.next();
ref = entry.getValue();
if ((ref.length() - 8) % 10 != 0) continue;
dom = entry.getKey(); dom = entry.getKey();
if (dom.length() >= 8) break; if (dom.length() >= 8) break;
if (!i.hasNext()) { dom = null;
nextentry = null;
return;
}
} }
if ((entry == null) || (dom == null)) { if ((entry == null) || (dom == null)) {
nextentry = null; nextentry = null;
return; return;
} }
ref = entry.getValue(); assert (ref.length() - 8) % 10 == 0 : "refs = " + ref + ", length = " + ref.length();
nextentry = new structureEntry(dom.substring(0, 6), dom.substring(7), ref.substring(0, 8), refstr2map(ref)); nextentry = new structureEntry(dom.substring(0, 6), dom.substring(7), ref.substring(0, 8), refstr2map(ref));
} }

Loading…
Cancel
Save