Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function getPasteId($paste_text) {
- $api_dev_key = 'change me plz ty xoxoxoxo'; // your api_developer_key
- $url = 'http://pastebin.com/api/api_post.php';
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, 'api_option=paste&api_dev_key='.$api_dev_key.'&api_paste_code='.$paste_text.'');
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_VERBOSE, 1);
- curl_setopt($ch, CURLOPT_NOBODY, 0);
- $response = curl_exec($ch);
- return str_replace("http://pastebin.com/", "", $response);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment