I've been trying to get the pastebin API to instead of telling me the pastebin link , just output the raw data. The PHP code is this :
<?php
$api_dev_key        = 'Stackoverflow(fake key)';    
$api_paste_code         = 'API.'; // your paste text
$api_paste_private      = '1'; // 0=public 1=unlisted 2=private
$api_paste_expire_date  = 'N';
$api_paste_format       = 'php';
$api_paste_code     = urlencode($api_paste_code);
$url            = 'http://pastebin.com/api/api_post.php';
$ch             = curl_init($url);
?>
Normally this would upload the $api_paste_code into pastebin , showing up like pastebin.com/St4ck0v3RFL0W , but instead I want it to generate the raw data.
The raw data link is http://pastebin.com/raw.php?i= , can anyone help?
Reference : http://pastebin.com/api
 
                        
First off, please note that you must send a
POSTrequest to the pastebin.com API, notGET. So don't useurlencode()on your input data!To get the raw paste url from the page url, you have several options. But the easiest is probably:
Finally, here is a complete example:
Running the above code, outputs: