/* 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 DeLeetPlugin extends webraveler.ravel.RavelerPlugin { /* variables */ String fullURL; /* constructors */ /** * The default constructor, called from WebRaveler2.Raveler */ public DeLeetPlugin() { name = "DeLeetPlugin"; 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("DeLeetPlugin: Starting find/replace. . ."); response.htmlPage.replaceText("4","a"); response.htmlPage.replaceText("0","o"); response.htmlPage.replaceText("7","t"); response.htmlPage.replaceText("9","g"); response.htmlPage.replaceText("1","l"); response.htmlPage.replaceText("3","e"); response.htmlPage.replaceText("5","s"); response.htmlPage.replaceText("[(]","c"); response.htmlPage.replaceText("[|][-][|]","h"); System.out.println("DeLeetPlugin: [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 :: DeLeetPlugin"; helpfulHTML += "

DeLeetPlugin :: 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