diff options
Diffstat (limited to 'blapaste.php')
-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"; |