package buzzerproxy; import buzzerproxy.CommunicationProtocol; import buzzerproxy.Crypto; import buzzerproxy.Google; import buzzerproxy.GoogleResultParser; import buzzerproxy.Gzip; import buzzerproxy.IO; import buzzerproxy.Logging; import buzzerproxy.XMLParser; import buzzerproxy.bprot.ByteProtServer; import buzzerproxy.handler.ExceptionHandler; import buzzerproxy.handler.QuestionInterface; import java.net.ServerSocket; import java.net.Socket; import java.util.logging.Level; import java.util.logging.Logger; import java.io.*; import java.util.ArrayList; import java.util.HashMap; /** * * @author Enger */ public class TestClass { public static void main(String[] args) { // TODO code application logic here // BuzzerProxy proxy = new BuzzerProxy(); Google g = new Google(); IO io = new IO(); GoogleResultParser gr = new GoogleResultParser(); String searchquery = "Madonna"; String filetyp = ".mp3+.wav+.flac"; String uri = "http://www.google.de/stress.mp3"; if (io.isValidFileTyp(uri, filetyp)) { System.out.println("ValidFileTyp: " + uri); } String googleResultString = g.getGoogleContent(searchquery, filetyp); System.out.println("googleResultString:" + googleResultString); ArrayList result = gr.parseResults(googleResultString, filetyp); for (ResultContainer res : result) { System.out.println(res.getResultUrl()); } System.out.println("ArrayList Einträge:" + result.size() ); } // public static void main(String[] args) { }