diff options
author | Phil Burton <philbeansburton@gmail.com> | 2015-10-19 12:03:45 +0100 |
---|---|---|
committer | Phil Burton <philbeansburton@gmail.com> | 2015-10-19 12:03:45 +0100 |
commit | e3aadde90723c481a4fef5e85dbb7b2ed82bbe55 (patch) | |
tree | a7ccc3884f14cef54c019735041eabfd6d1c9562 | |
parent | 18bad122b749cfd1135e483a50bc44d20efe3910 (diff) |
undid stuff
-rwxr-xr-x | blapaste.php | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/blapaste.php b/blapaste.php index f400a94..f3b2815 100755 --- a/blapaste.php +++ b/blapaste.php @@ -1,2 +1,24 @@ -blapaste.php -README.md + #!/usr/bin/php +<?php +$stdin = fopen("php://stdin", "r"); +$paste = ""; +while (false !== ($line = fgets($stdin))) { + $paste .= $line; +} +$url = "http://p.of.je/submit.php"; +$myvars = "paste=" . $paste; +$ch = curl_init($url); +curl_setopt($ch, CURLOPT_POST, 1); +curl_setopt($ch, CURLOPT_POSTFIELDS, $myvars); +curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); +curl_setopt($ch, CURLOPT_HEADER, 1); +curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); +$response = curl_exec($ch); +$response = explode("\n", $response); +foreach ($response as $line) { + if (strpos($line, "Location") !== false) { + echo $line . "\n"; + exit; + } +} +echo "failed\n"; |