Read SHOUTcast's 7.html with Java
<p>Alright, I'm at my wit's end. I've been trying for ~hours~ to read the following url in to a Java string and I can't for the life of me do it. I've tried about a bajillion different methods (that all work for other web pages!) I've found online and I'm about to lose my mind! Please help me get the contents of this web page in to a Java string~ :(</p>

<p><a href="http://molestia.ponify.me:8062/7.html" rel="nofollow">http://molestia.ponify.me:8062/7.html</a></p>

<p><strong>ANSWER:</strong></p>

<pre><code>URL url = new URL("http://molestia.ponify.me:8062/7.html");
URLConnection con = url.openConnection();
con.setRequestProperty("User-Agent", "Mozilla/5.0"); // This bugger right here saved the day!

Reader r = new InputStreamReader(con.getInputStream());
StringBuilder buf = new StringBuilder();

while (true) {
    int ch = r.read();

    if (ch &lt; 0)
        break;

    buf.append((char) ch);
}

String str = buf.toString();

Log.d("HTML", str);
</code></pre>
