Skip to content

Instantly share code, notes, and snippets.

@phase
Created January 23, 2015 01:32
Show Gist options
  • Save phase/42b17702bba724d08582 to your computer and use it in GitHub Desktop.
Save phase/42b17702bba724d08582 to your computer and use it in GitHub Desktop.
Gets the contents of a site.
URL url = new URL("http://www.website.com/");
BufferedReader br = new BufferedReader(
new InputStreamReader(
url .openStream()));
String line;
String contents;
while ((line= br.readLine()) != null)
contents += line + "\n";
in.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment