Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'cleanstring.php';
- $loop = 1;
- $user = $_GET['user'];
- $permlink = $_GET['permlink'];
- $jsid = rand(1,90);
- $content = "{
- \"id\":\"$jsid\",
- \"jsonrpc\":\"2.0\",
- \"method\":\"get_content\",
- \"params\":[\"$user\",\"$permlink\"]
- }";
- $url = "http://steemd.privex.io/";
- $curl = curl_init($url);
- curl_setopt($curl, CURLOPT_HEADER, false);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curl, CURLOPT_HTTPHEADER,
- array("Content-type: application/json"));
- curl_setopt($curl, CURLOPT_POST, true);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
- $json_response = curl_exec($curl);
- $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
- if ( $status != 200 ) {
- $url = "https://api.steemit.com/";
- $curl = curl_init($url);
- curl_setopt($curl, CURLOPT_HEADER, false);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curl, CURLOPT_HTTPHEADER,
- array("Content-type: application/json"));
- curl_setopt($curl, CURLOPT_POST, true);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
- $json_response = curl_exec($curl);
- $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
- if ( $status != 200 )
- {
- die("No Steem Api response, please try again.");
- }
- }
- curl_close($curl);
- $response = json_decode($json_response, true);
- $compbody = $response['result']['body'];
- $teile = explode("base64filename", $compbody);
- $filename = $teile['1'];
- $filebodyprep = $teile['2'];
- $teile = explode("base64file",$filebodyprep);
- $filebody = $teile['1'];
- $filename = removespace($filename);
- $tempdir = sys_get_temp_dir();
- $tmpName = "$tempdir/$filename";
- $filebodyprep = $teile['2'];
- $teile = explode("base64chunks",$filebodyprep);
- $chunkcount = $teile['1'];
- $chunkcount = removespace($chunkcount);
- $parentlink = $permlink;
- $chunkcount = $chunkcount -1;
- while ($loop <= $chunkcount)
- {
- $sublink = "$parentlink subpost $loop";
- $sublink = removespace($sublink);
- $permlink = $sublink;
- $jsid = rand(1,90);
- $content = "{
- \"id\":\"$jsid\",
- \"jsonrpc\":\"2.0\",
- \"method\":\"get_content\",
- \"params\":[\"$user\",\"$permlink\"]
- }";
- $url = "http://steemd.privex.io/";
- $curl = curl_init($url);
- curl_setopt($curl, CURLOPT_HEADER, false);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curl, CURLOPT_HTTPHEADER,
- array("Content-type: application/json"));
- curl_setopt($curl, CURLOPT_POST, true);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
- $json_response = curl_exec($curl);
- $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
- if ( $status != 200 ) {
- $url = "https://api.steemit.com/";
- $curl = curl_init($url);
- curl_setopt($curl, CURLOPT_HEADER, false);
- curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($curl, CURLOPT_HTTPHEADER,
- array("Content-type: application/json"));
- curl_setopt($curl, CURLOPT_POST, true);
- curl_setopt($curl, CURLOPT_POSTFIELDS, $content);
- $json_response = curl_exec($curl);
- $status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
- if ( $status != 200 )
- {
- die("No Steem Api response, please try again.");
- }
- }
- curl_close($curl);
- $response = json_decode($json_response, true);
- $compbody = $response['result']['body'];
- $teile = explode("base64filename", $compbody);
- $filename = $teile['1'];
- $filebodyprep = $teile['2'];
- $teile = explode("base64file",$filebodyprep);
- $filepart = $teile['1'];
- $filebody = "$filebody $filepart";
- $filebody = removespace($filebody);
- $loop++;
- }
- $filebody = base64_decode($filebody);
- $file = fopen($tmpName, 'w');
- fwrite($file, $filebody);
- fclose($file);
- header('Content-Description: File Transfer');
- header('Content-Type: application/octet-stream');
- header('Content-Disposition: attachment; filename="'.basename($tmpName).'"');
- header('Pragma: public');
- header('Content-Length: ' . filesize($tmpName));
- readfile($tmpName);
- ob_clean();
- flush();
- unlink($tmpName);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement