public static String getWebpageTitle(String s) {
        //Stolen from https://github.com/zack6849/Alphabot/blob/master/src/com/zack6849/alphabot/Utils.java :3
        String title = "";
        String error = "none!";
        try {
            Document doc = Jsoup.connect(s).userAgent("Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.56 Safari/537.17").get();

            Elements links = doc.select("title");
            for (Element e1 : links) {
                title += e1.text().replaceAll("\n", "").replaceAll("\\s+", " ");
            }
        } catch (Exception e) {
            error = e.toString().split(":")[1].split("Status=")[1].split(",")[0];
        }
        if (!error.equalsIgnoreCase("none")) {
            if (error.contains("404")) {
                return "Error: 404";
            }
            if (error.contains("502")) {
                return "Error: 502";
            }
            if (error.contains("401")) {
                return "Error: 401";
            }
            if (error.contains("403")) {
                return "Error: 403";
            }
            if (error.contains("500")) {
                return "Error: 500";
            }
            if (error.contains("503")) {
                return "Error: 503";
            }
        }
        return title;
    }