@@ -0,0 +1,1809 @@
+package at.GT.Client;%0A%0Aimport java.io.BufferedReader;%0Aimport java.io.IOException;%0Aimport java.io.InputStreamReader;%0A%0Aimport org.apache.http.HttpEntity;%0Aimport org.apache.http.HttpResponse;%0Aimport org.apache.http.client.ClientProtocolException;%0Aimport org.apache.http.client.HttpClient;%0Aimport org.apache.http.client.methods.HttpGet;%0Aimport org.apache.http.impl.client.HttpClients;%0A%0Aimport at.GT.RequestCreater.*;%0A%0Apublic class GoogleTrendsClient %7B%0A%09%0A%09public static String CreateRequest(String query)%7B%0A%09%09if (query.length() == 0)%7B%0A%09%09%09return null;%0A%09%09%7D else %7B%0A%09%09%09GoogleTrendsRequest newrequest = new GoogleTrendsRequest(query);%0A%09%09%09return newrequest.constructQuery();%0A%09%09%7D%09%0A%09%7D%0A%09%0A%09public static void ExecutePost(String url) throws ClientProtocolException, IOException%7B%0A%09%09HttpClient httpclient = HttpClients.createDefault();%0A%09%09HttpGet post = new HttpGet(url);%0A%09%09HttpResponse response = httpclient.execute(post);%0A%09%09HttpEntity entity = response.getEntity();%0A%09%09%0A%09%09ReadEntity(entity);%0A%09%09%0A%09%7D%0A%09%0A%09public static void ReadEntity(HttpEntity entity) throws UnsupportedOperationException, IOException%7B%0A%09%09String string;%0A%09%09StringBuilder output = new StringBuilder();%0A%09%09if (entity.getContent() != null)%7B%0A%09%09%09BufferedReader reader = new BufferedReader(new InputStreamReader(entity.getContent()));%0A%09%09%09%0A%09        while ((string = reader.readLine()) != null) %7B%0A%09            output.append(string);%0A%09        %7D%0A%09        reader.close();%0A%09%09%7D%0A        System.out.println(output.toString());%0A%09%7D%0A%0A%09public static void main(String%5B%5D args) %7B%0A%09%09String request = CreateRequest(%22java%22);%0A%09%09System.out.println(request);%0A%09%09try %7B%0A%09%09%09ExecutePost(request);%0A%09%09%7D catch (ClientProtocolException e) %7B%0A%09%09%09// TODO Auto-generated catch block%0A%09%09%09e.printStackTrace();%0A%09%09%7D catch (IOException e) %7B%0A%09%09%09// TODO Auto-generated catch block%0A%09%09%09e.printStackTrace();%0A%09%09%7D%0A%09%7D%0A%0A%7D%0A

Create GoogleTrendsClient.java