/* this belongs to the WebRaveler package */ package webraveler.plugin; import java.util.*; import webraveler.http.HTTPResponse; import webraveler.ravel.PluginAPI; import webraveler.ravel.Raveler; import webraveler.vurl.HelpVURL; /** * Is the Web not 1337 enough for you? Then use this plugin! * * @author The Web Raveler Development Squad * @version 1.0 */ public class LeetifyPlugin extends webraveler.ravel.RavelerPlugin { /* variables */ private String fullURL; /* constructors */ /** * The default constructor, called from WebRaveler2.Raveler */ public LeetifyPlugin() { name = "LeetifyPlugin"; mimeTypes.add("text/html"); } /* methods */ /** * Start executing the plugin when given a response * * @param response an HTTPResponse with the response to be modified * @return an HTTPResponse object, the result of running the plugin on the input response */ public HTTPResponse execute(HTTPResponse response, Hashtable attributes) { System.out.println("LeetifyPlugin: Starting find/replace. . ."); response.getHtmlPage().replaceText("[Cc][Oo][Ll][Ll][Ee][Gg][Ee]","c011393, d00dz!"); response.getHtmlPage().replaceText("[Aa]","4"); response.getHtmlPage().replaceText("[Ll]","1"); response.getHtmlPage().replaceText("[Hh]","|-|"); response.getHtmlPage().replaceText("[Ee]","3"); response.getHtmlPage().replaceText("[Gg]","9"); response.getHtmlPage().replaceText("[Cc]","("); response.getHtmlPage().replaceText("[Ss]","5"); response.getHtmlPage().replaceText("[Mm]","|\\/|"); response.getHtmlPage().replaceText("[Tt]","7"); response.getHtmlPage().replaceText("[Oo]","0"); response.getHtmlPage().replaceText("&nb5p;"," "); response.getHtmlPage().replaceText("&4mp;","&"); response.getHtmlPage().replaceText("&qu07;","""); System.out.println("LeetifyPlugin: [done]\n"); response.correctContentLength(); return response; } /** * Do the setup stuff with Raveler - banner setup, etc. * Put the plugin on Raveler's "plugin vector" */ public boolean initialize() { /* some helpful HTML to display to the user */ String helpfulHTML = new String(); helpfulHTML += ""+Raveler.ravelerCSS+"WebRaveler2 :: LeetifyPlugin"; helpfulHTML += "

LeetifyPlugin :: About

"; helpfulHTML += "

"; HelpVURL help = new HelpVURL(helpfulHTML); fullURL = PluginAPI.addPluginVirtualURL(ravel,name,help); return true; } /** * Terminate the Plugin - Hasta la vista, BABY! */ public void terminate() { } /** * Return the default configuration for this plugin as a hash table. * */ public void setDefaultAttributes() { attributes = new Hashtable(); } } //class RavelerPlugin