Skip to content

Instantly share code, notes, and snippets.

@jasonroelofs
Created January 27, 2014 19:58
Show Gist options
  • Save jasonroelofs/8656103 to your computer and use it in GitHub Desktop.
Save jasonroelofs/8656103 to your computer and use it in GitHub Desktop.
Simple Snitching in Java
// Using raw java.net.*
URL obj = new URL("https://nosnch.in/[snitch code]?m=[message]");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.getResponseCode();
// Apache HttpComponents http://hc.apache.org/httpcomponents-client-ga/quickstart.html
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpGet httpGet = new HttpGet("https://nosnch.in/[snitch code]?m=[message]");
CloseableHttpResponse response1 = httpclient.execute(httpGet);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment