diff options
Diffstat (limited to 'blapaste.php')
-rwxr-xr-x | blapaste.php | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/blapaste.php b/blapaste.php new file mode 100755 index 0000000..a46a3c1 --- /dev/null +++ b/blapaste.php @@ -0,0 +1,29 @@ +#!/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"; |