Skip to content

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

Scroogle is not comming back, remove dead code

Roland 'Quix0r' Haederaf5a597e47cd
diff --git a/defaults/yacy.init b/defaults/yacy.init
index 309531a50..9d8ceda59 100644
--- a/defaults/yacy.init
+++ b/defaults/yacy.init
@@ -1011,7 +1011,6 @@ about.body =
# search heuristics
heuristic.site = false
-heuristic.scroogle = false
heuristic.blekko = false
# colours for generic design
diff --git a/htroot/ConfigHeuristics_p.html b/htroot/ConfigHeuristics_p.html
index 91cc76746..0778c9396 100644
--- a/htroot/ConfigHeuristics_p.html
+++ b/htroot/ConfigHeuristics_p.html
@@ -43,20 +43,6 @@
</p>
</fieldset>
</form>
- <!--
- <form id="HeuristicFormScroogle" method="post" action="ConfigHeuristics_p.html" enctype="multipart/form-data" accept-charset="UTF-8">
- <fieldset>
- <legend>
- <input type="checkbox" name="scroogle_check" id="scroogle" onclick="window.location.href='ConfigHeuristics_p.html?#(scroogle.checked)#scroogle_on=::scroogle_off=#(/scroogle.checked)#'" value="scroogle"#(scroogle.checked)#:: checked="checked"#(/scroogle.checked)# />
- <label for="scroogle">scroogle: load external search result list from <a href="http://scroogle.org">scroogle</a></label>
- </legend>
- <p>
- When using this heuristic, then every search request line is used for a call to scroogle.
- 20 results are taken from scroogle and loaded simultanously, parsed and indexed immediately.
- </p>
- </fieldset>
- </form>
- -->
<form id="HeuristicFormBlekko" method="post" action="ConfigHeuristics_p.html" enctype="multipart/form-data" accept-charset="UTF-8">
<fieldset>
<legend>
@@ -73,4 +59,4 @@
#%env/templates/footer.template%#
</body>
-</html>
\ No newline at end of file
+</html>
diff --git a/htroot/ConfigHeuristics_p.java b/htroot/ConfigHeuristics_p.java
index f60abe374..3ea6031cd 100644
--- a/htroot/ConfigHeuristics_p.java
+++ b/htroot/ConfigHeuristics_p.java
@@ -45,14 +45,11 @@ public class ConfigHeuristics_p {
if (post.containsKey("site_on")) sb.setConfig("heuristic.site", true);
if (post.containsKey("site_off")) sb.setConfig("heuristic.site", false);
- if (post.containsKey("scroogle_on")) sb.setConfig("heuristic.scroogle", true);
- if (post.containsKey("scroogle_off")) sb.setConfig("heuristic.scroogle", false);
if (post.containsKey("blekko_on")) sb.setConfig("heuristic.blekko", true);
if (post.containsKey("blekko_off")) sb.setConfig("heuristic.blekko", false);
}
prop.put("site.checked", sb.getConfigBool("heuristic.site", false) ? 1 : 0);
- prop.put("scroogle.checked", sb.getConfigBool("heuristic.scroogle", false) ? 1 : 0);
prop.put("blekko.checked", sb.getConfigBool("heuristic.blekko", false) ? 1 : 0);
return prop;
diff --git a/htroot/ConfigNetwork_p.java b/htroot/ConfigNetwork_p.java
index e78ab69d0..385abe40d 100644
--- a/htroot/ConfigNetwork_p.java
+++ b/htroot/ConfigNetwork_p.java
@@ -87,7 +87,6 @@ public class ConfigNetwork_p
if ( !indexReceive ) {
// remove heuristics
sb.setConfig("heuristic.site", false);
- sb.setConfig("heuristic.scroogle", false);
sb.setConfig("heuristic.blekko", false);
}
final boolean robinsonmode = "robinson".equals(post.get("network", ""));
diff --git a/source/net/yacy/search/Switchboard.java b/source/net/yacy/search/Switchboard.java
index 7e40457be..b3452c5e4 100644
--- a/source/net/yacy/search/Switchboard.java
+++ b/source/net/yacy/search/Switchboard.java
@@ -1190,7 +1190,6 @@ public final class Switchboard extends serverSwitch
// remove heuristics
setConfig("heuristic.site", false);
- setConfig("heuristic.scroogle", false);
setConfig("heuristic.blekko", false);
// relocate
@@ -3152,8 +3151,8 @@ public final class Switchboard extends serverSwitch
final Map<MultiProtocolURI, String> links;
searchEvent.getRankingResult().oneFeederStarted();
- try {
- links = Switchboard.this.loader.loadLinks(url, CacheStrategy.NOCACHE);
+ try {
+ links = Switchboard.this.loader.loadLinks(url, CacheStrategy.NOCACHE);
if ( links != null ) {
final Iterator<MultiProtocolURI> i = links.keySet().iterator();
while ( i.hasNext() ) {
@@ -3166,59 +3165,7 @@ public final class Switchboard extends serverSwitch
addAllToIndex(url, links, searchEvent, "site");
}
} catch ( final Throwable e ) {
- Log.logException(e);
- } finally {
- searchEvent.getRankingResult().oneFeederTerminated();
- }
- }
- }.start();
- }
-
- public final void heuristicScroogle(final SearchEvent searchEvent) {
- new Thread() {
- @Override
- public void run() {
- QueryParams query = searchEvent.getQuery();
- String queryString = query.queryString(true);
- final int meta = queryString.indexOf("heuristic:", 0);
- if ( meta >= 0 ) {
- final int q = queryString.indexOf(' ', meta);
- queryString =
- (q >= 0)
- ? queryString.substring(0, meta) + queryString.substring(q + 1)
- : queryString.substring(0, meta);
- }
- final String urlString =
- "http://www.scroogle.org/cgi-bin/nbbw.cgi?Gw="
- + queryString.trim().replaceAll(" ", "+")
- + "&n=2";
- final DigestURI url;
- try {
- url = new DigestURI(MultiProtocolURI.unescape(urlString));
- } catch ( final MalformedURLException e1 ) {
- Log.logWarning("heuristicScroogle", "url not well-formed: '" + urlString + "'");
- return;
- }
-
- Map<MultiProtocolURI, String> links = null;
- searchEvent.getRankingResult().oneFeederStarted();
- try {
- links = Switchboard.this.loader.loadLinks(url, CacheStrategy.NOCACHE);
- if ( links != null ) {
- final Iterator<MultiProtocolURI> i = links.keySet().iterator();
- while ( i.hasNext() ) {
- if ( i.next().toNormalform(false, false).indexOf("scroogle", 0) >= 0 ) {
- i.remove();
- }
- }
- Switchboard.this.log.logInfo("Heuristic: adding "
- + links.size()
- + " links from scroogle");
- // add all pages to the index
- addAllToIndex(null, links, searchEvent, "scroogle");
- }
- } catch ( final Throwable e ) {
- //Log.logException(e);
+ Log.logException(e);
} finally {
searchEvent.getRankingResult().oneFeederTerminated();
}