Skip to content

Instantly share code, notes, and snippets.

@cyyself
Last active Sep 19, 2018
Embed
What would you like to do?
<?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