animation of the web structure picture

pull/1/head Release_1.02
Michael Peter Christen 13 years ago
parent 898fa7c3f3
commit 8c06925984

@ -18,6 +18,21 @@
text-align:right;
}
</style>
<script type="text/javascript">
<!--
imagestub = "WebStructurePicture_p.png?host=#[besthost]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodes]#&amp;time=#[time]#&amp;colortext=#[colortext]#&amp;colorback=#[colorback]#&amp;colordot=#[colordot]#&amp;colorline=#[colorline]#&amp;colorlineend=#[colorlineend]#";
idx = 0;
setTimeout("doanimation()", 3000);
function doanimation() {
var accessPicture = document.getElementById("WebPicture");
if (accessPicture != null) {
idx++;
accessPicture.src = imagestub + "&idx=" + idx;
setTimeout("doanimation()", 3000);
}
}
-->
</script>
</head>
<body id="WebStructure" style="margin:0px;">
#%env/templates/header.template%#
@ -93,7 +108,7 @@ To see a list of all APIs, please visit the <a href="http://www.yacy-websuche.de
</form>
</div><br />
<div style="text-align:right;">
<img src="WebStructurePicture_p.png?host=#[besthost]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodes]#&amp;time=#[time]#&amp;colortext=#[colortext]#&amp;colorback=#[colorback]#&amp;colordot=#[colordot]#&amp;colorline=#[colorline]#&amp;colorlineend=#[colorlineend]#" alt="WebStructurePicture"/>
<img id="WebPicture" src="WebStructurePicture_p.png?host=#[besthost]#&amp;depth=#[depth]#&amp;width=#[width]#&amp;height=#[height]#&amp;nodes=#[nodes]#&amp;time=#[time]#&amp;colortext=#[colortext]#&amp;colorback=#[colorback]#&amp;colordot=#[colordot]#&amp;colorline=#[colorline]#&amp;colorlineend=#[colorlineend]#" alt="WebStructurePicture"/>
</div>
#%env/templates/footer.template%#
</body>

@ -64,11 +64,19 @@ public class WatchWebStructure_p {
}
}
// fix start point if a "www."-prefix would be better
if (host != null && !host.startsWith("www")) {
if (sb.webStructure.referencesCount(DigestURI.hosthash6("www." + host)) > sb.webStructure.referencesCount(DigestURI.hosthash6(host))) {
host = "www." + host;
}
}
// find start point
if (host == null ||
host.length() == 0 ||
host.equals("auto") ||
sb.webStructure.referencesCount(DigestURI.hosthash6(host)) == 0) {
host.equals("auto")
// || sb.webStructure.referencesCount(DigestURI.hosthash6(host)) == 0
) {
// find domain with most references
besthost = sb.webStructure.hostWithMaxReferences();
if (besthost == null) besthost = host;

@ -155,7 +155,7 @@ public class WebStructurePicture_p {
int maxtargetrefs = 8, maxthisrefs = 8;
int targetrefs, thisrefs;
double rr, re;
while ((i.hasNext()) && (maxnodes > 0) && (System.currentTimeMillis() < timeout)) {
while (i.hasNext() && maxnodes > 0 && System.currentTimeMillis() < timeout) {
entry = i.next();
targethash = entry.getKey();
targethost = structure.hostHash2hostName(targethash);

@ -35,7 +35,7 @@
<h3>Monitoring</h3>
<ul class="menu">
<li><a href="/Network.html" accesskey="w" class="MenuItemLink">YaCy Network</a></li>
<li><a href="/WatchWebStructure_p.html?host=auto&amp;depth=2&amp;time=1000" class="MenuItemLink lock">Web Visualization</a></li>
<li><a href="/WatchWebStructure_p.html?host=auto&amp;depth=3&amp;time=1000" class="MenuItemLink lock">Web Visualization</a></li>
<li><a href="/AccessGrid_p.html" class="MenuItemLink lock">Network Access</a></li>
<li><a href="/ViewLog_p.html" class="MenuItemLink lock">Computation</a></li>
<li><a href="/terminal_p.html" accesskey="t" class="MenuItemLink lock">Terminal</a></li>

@ -130,12 +130,12 @@ public class WebStructureGraph
delcount--;
}
}
this.publicRefDNSResolvingWorker = new PublicRefDNSResolvingProcess();
this.publicRefDNSResolvingWorker.start();
}
private class PublicRefDNSResolvingProcess extends Thread
{
private class PublicRefDNSResolvingProcess extends Thread {
private PublicRefDNSResolvingProcess() {
}
@ -664,8 +664,7 @@ public class WebStructureGraph
// find host with most references
String maxhost = null;
int refsize, maxref = 0;
joinOldNew();
synchronized ( this.structure_new ) {
synchronized ( this.structure_old ) {
for ( final Map.Entry<String, String> entry : this.structure_old.entrySet() ) {
refsize = entry.getValue().length();
if ( refsize > maxref ) {
@ -674,6 +673,15 @@ public class WebStructureGraph
}
}
}
synchronized ( this.structure_new ) {
for ( final Map.Entry<String, String> entry : this.structure_new.entrySet() ) {
refsize = entry.getValue().length();
if ( refsize > maxref ) {
maxref = refsize;
maxhost = entry.getKey().substring(7);
}
}
}
return maxhost;
}

Loading…
Cancel
Save