diff --git a/htroot/xml/util/getpageinfo_p.java b/htroot/xml/util/getpageinfo_p.java index 86f57d4ef..7c189fa2e 100644 --- a/htroot/xml/util/getpageinfo_p.java +++ b/htroot/xml/util/getpageinfo_p.java @@ -46,19 +46,21 @@ // if the shell's current path is HTROOT package xml.util; import java.io.IOException; +import java.io.Writer; import java.net.MalformedURLException; import java.util.ArrayList; -import java.util.Iterator; -import de.anomic.data.htmlTools; + import de.anomic.data.robotsParser; +import de.anomic.htmlFilter.htmlFilterContentScraper; +import de.anomic.htmlFilter.htmlFilterWriter; import de.anomic.http.httpHeader; import de.anomic.http.httpc; import de.anomic.net.URL; import de.anomic.plasma.plasmaSwitchboard; +import de.anomic.server.serverFileUtils; import de.anomic.server.serverObjects; import de.anomic.server.serverSwitch; -import de.anomic.tools.nxTools; public class getpageinfo_p { public static serverObjects respond(httpHeader header, serverObjects post, serverSwitch env) { @@ -81,22 +83,20 @@ public class getpageinfo_p { if (actions.indexOf("title")>=0) { try { URL u = new URL(url); - content = nxTools.strings(httpc.wget(u, u.getHost(), 6000, null, null, ((plasmaSwitchboard) env).remoteProxyConfig, null)); - Iterator it = content.iterator(); - String line; - String title; - while (it.hasNext()) { - line = (String) it.next(); - try { - title = line.substring(line.toLowerCase().indexOf( - "") + 7, line.toLowerCase().indexOf( - "")); - // de-replace html entities - title = htmlTools.deReplaceHTML(title); - prop.put("title", title); - } catch (IndexOutOfBoundsException e) { - } + String contentString=new String(httpc.wget(u, u.getHost(), 6000, null, null, ((plasmaSwitchboard) env).remoteProxyConfig, null)) ; + + htmlFilterContentScraper scraper = new htmlFilterContentScraper(u); + //OutputStream os = new htmlFilterOutputStream(null, scraper, null, false); + Writer writer = new htmlFilterWriter(null,null,scraper,null,false); + serverFileUtils.write(contentString,writer); + writer.close(); + + prop.put("title", scraper.getTitle()); + String list[]=scraper.getKeywords(); + for(int i=0;i#[title]# #(robots-allowed)#0::1::#(/robots-allowed)# #[sitemap]# + + #{tags}# + + #{/tags}# + \ No newline at end of file