Kezz101

Pastebin.php

Nov 4th, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php
  2.  
  3. function getPasteId($paste_text) {
  4.     $api_dev_key = 'change me plz ty xoxoxoxo'; // your api_developer_key
  5.  
  6.     $url = 'http://pastebin.com/api/api_post.php';
  7.     $ch = curl_init($url);
  8.  
  9.     curl_setopt($ch, CURLOPT_POST, true);
  10.     curl_setopt($ch, CURLOPT_POSTFIELDS, 'api_option=paste&api_dev_key='.$api_dev_key.'&api_paste_code='.$paste_text.'');
  11.     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  12.     curl_setopt($ch, CURLOPT_VERBOSE, 1);
  13.     curl_setopt($ch, CURLOPT_NOBODY, 0);
  14.  
  15.     $response = curl_exec($ch);
  16.     return str_replace("http://pastebin.com/", "", $response);
  17. }
  18.  
  19. ?>
Advertisement
Add Comment
Please, Sign In to add comment