Skip to content

Instantly share code, notes, and snippets.

@phl0w
Created June 28, 2012 20:03
Show Gist options
  • Select an option

  • Save phl0w/3013563 to your computer and use it in GitHub Desktop.

Select an option

Save phl0w/3013563 to your computer and use it in GitHub Desktop.
@Override
public void onStop() {
try {
URL submit = new URL(
"http://site.com/submit.php?user=(...)&timeran=(...)&otherparameters=...");
URLConnection con = submit.openConnection();
con.setRequestProperty(
"User-Agent",
"| i recommend you set a fake user agent which you read on the website side by $_SERVER['HTTP_USER_AGENT'] |");
con.setDoInput(true);
con.setDoOutput(true);
con.setUseCaches(false);
final BufferedReader rd = new BufferedReader(new InputStreamReader(
con.getInputStream()));
String line;
while ((line = rd.readLine()) != null) {
if (line.toLowerCase().contains("success")) {
log.info("Successfully updated signature.");
} else if (line.toLowerCase().contains("fuck off")) {
log.info("Something fucked up, couldn't update.");
}
}
rd.close();
} catch (Exception e) {
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment