Skip to content

Instantly share code, notes, and snippets.

@cyyself
Last active September 19, 2018 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cyyself/966a2e82f090c7da93539e759c8b0853 to your computer and use it in GitHub Desktop.
Save cyyself/966a2e82f090c7da93539e759c8b0853 to your computer and use it in GitHub Desktop.
<?php
$curl_cmd = trim(fgets(STDIN));
$filename = md5($curl_cmd) . '.html';
while (1) {
$ret = shell_exec($curl_cmd.' -w %{http_code} -o '. $filename .' -i');
if ($ret != '503') break;
}
echo 'Saved to ' . $filename . "\n";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment