From af5a597e47cdec9d5d8061b47f12508acb67df85 Mon Sep 17 00:00:00 2001 From: Roland 'Quix0r' Haeder Date: Sun, 10 Jun 2012 23:38:41 +0200 Subject: [PATCH] Scroogle is not comming back, remove dead code Conflicts: source/net/yacy/search/Switchboard.java --- defaults/yacy.init | 1 - htroot/ConfigHeuristics_p.html | 16 +------ htroot/ConfigHeuristics_p.java | 3 -- htroot/ConfigNetwork_p.java | 1 - source/net/yacy/search/Switchboard.java | 59 ++----------------------- 5 files changed, 4 insertions(+), 76 deletions(-) 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 @@

-
@@ -73,4 +59,4 @@ #%env/templates/footer.template%# - \ No newline at end of file + 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 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 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 links = null; - searchEvent.getRankingResult().oneFeederStarted(); - try { - links = Switchboard.this.loader.loadLinks(url, CacheStrategy.NOCACHE); - if ( links != null ) { - final Iterator 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(); }