因此,我使用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;为了获取您需要的用户密钥(开发人员密钥、用户名和密码),您为什么需要他们的凭据来列出他们的粘贴?有没有办法在没有他们的情况下这样做呢?
发布于 2019-02-13 13:19:37
在此处生成api_userkey:
除非需要,否则不需要再次生成它。你需要和你的api_dev_key一起使用。另外,我强烈推荐使用这个包:
https://stackoverflow.com/questions/44816655
复制相似问题