@@ -0,0 +1,1974 @@
+import java.io.IOException;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport java.util.Map;%0Aimport java.util.Map.Entry;%0Aimport java.util.TreeMap;%0A%0Aimport com.google.gson.JsonElement;%0Aimport com.google.gson.JsonObject;%0Aimport com.google.gson.JsonParser;%0A%0Aimport okhttp3.OkHttpClient;%0Aimport okhttp3.Request;%0Aimport okhttp3.Response;%0A%0Apublic class OkHttpRunner %7B%0A%0A    public static OkHttpClient client = new OkHttpClient();%0A%0A    public static void main(String%5B%5D args) throws Exception %7B%0A        // I found this URL in this node library:%0A        // https://github.com/pat310/google-trends-api/blob/master/src/utils/hotTrends.js%0A%0A        String result = run(%22http://hawttrends.appspot.com/api/terms/%22);%0A        JsonParser parser = new JsonParser();%0A        JsonObject o = parser.parse(result).getAsJsonObject();%0A        %0A        // map %0A        //   -%3E arrays%0A        Map%3CInteger, List%3CString%3E%3E trends = new TreeMap%3C%3E();%0A        %0A        for(Entry%3CString, JsonElement%3E entry : o.entrySet()) %7B%0A        %09Integer key = Integer.parseInt(entry.getKey());%0A        %09List%3CString%3E values = new ArrayList%3C%3E();%0A        %09%0A        %09for(JsonElement element : entry.getValue().getAsJsonArray()) %7B%0A        %09%09String trend = element.getAsString();%0A        %09%09values.add(trend);%0A        %09%7D%0A        %09%0A        %09trends.put(key, values);%0A        %7D%0A        %0A        //System.out.println(trends);%0A        for(Integer key : trends.keySet()) %7B%0A        %09System.out.println(%22Key: %22 + key);%0A        %09System.out.println(%22 --%3E Top trend 1: %22 + trends.get(key).get(0));%0A        %09System.out.println(%22 --%3E Top trend 2: %22 + trends.get(key).get(1));%0A        %09%0A        %7D%0A    %7D%0A%0A    // you can do this in vanilla java but a good library makes it WAY WAY WAY easier!%0A    private static String run(String url) throws IOException %7B%0A        Request request = new Request.Builder().url(url).build();%0A        Response response = client.newCall(request).execute();%0A        return response.body().string();%0A    %7D%0A%0A%0A%7D%0A

Create OkHttpRunner.java