1

所以,我使用 Pastebin 的 API ( https://pastebin.com/api#9 ) 来列出用户的帖子。但是根据它所说的,您似乎需要知道用户的密码才能列出粘贴?

PHP 脚本:

$api_dev_key        = 'DEV KEY';
$api_user_key       = 'USER KEY';
$api_results_limit  = '100';
$url            = 'https://pastebin.com/api/api_post.php';
$ch             = curl_init($url);

curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'api_option=list&api_user_key='.$api_user_key.'&api_dev_key='.$api_dev_key.'&api_results_limit='.$api_results_limit.'');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_NOBODY, 0);

$response       = curl_exec($ch);
echo $response;

为了获得您需要的用户密钥(开发密钥、用户名和密码),为什么需要他们的凭据来列出他们的粘贴?没有它们有什么方法可以做到吗?

4

1 回答 1

0

在此处生成 api_userkey:

https://pastebin(dot)com/api/api_user_key.html

除非您需要,否则无需再次生成它。您需要与您的 api_dev_key 一起使用。我也强烈推荐使用这个包:

https://github.com/gebn/Brush

于 2019-02-13T05:19:36.603 回答