我有wordpress博客,我想通过这个url缩短器缩短所有的url:http://smart-gpt.com/short/api.html这是api代码
API Address: http://smart-gpt.com
GET /short/api/v1/9f55f513858401acfd7d4a582715dd3c/shorturl/create/url/BASE64_ENCODED_LONG_URL.json
请帮帮我!
可以使用file_get_contents
例子:$response = file_get_contents("http://smart-gpt.com/short/api/v1/c411262dba62021ece8e2244fc6ef212/shorturl/create/url/".base64_encode($longurl).".json")
$responseobj = json_decode($response);
$shorturl = $responseobj->data->short_url;
这就是PHP。
我不知道如何在Wordpress中实现这个