当前位置:首页 > 代刷推荐 > 正文

输入视频号链接或账号信息

输入视频号链接或账号信息

请输入您要查询的视频号链接或账号信息,视频号链接,视频号账号,print,r,$video,info,echo,functionget,video,info,$vide...

输入视频号链接或账号信息  第2张

请输入您要查询的视频号链接或账号信息:

";print_r($video_info);echo "";}function get_video_info($video_url, $video_account) {// 获取视频号ID$video_id = parse_video_url($video_url);// 获取视频号信息$video_info = request_video_info($video_id, $video_account);return $video_info;}function parse_video_url($video_url) {// 正则匹配视频号IDpreg_match('/\/video\/(\d+)/', $video_url, $matches);return $matches[1];}function request_video_info($video_id, $video_account) {// 请求视频号信息$url = "https://api.weixin.qq.com/wxa/videonumber/videonumber/get?access_token=" . get_access_token();$data= ['video_number' => $video_id,'video_account' => $video_account,];$response = request_post($url, $data);return $response;}function get_access_token() {// 获取access_token$url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" . APPID . "&secret=" . SECRET;$response = request_get($url);return $response['access_token'];}function request_get($url) {// GET请求$curl = curl_init();curl_setopt($curl, CURLOPT_URL, $url);curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);$response = curl_exec($curl);curl_close($curl);return json_decode($response, true);}function request_post($url, $data) {// POST请求$curl = curl_init();curl_setopt($curl, CURLOPT_URL, $url);curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);curl_setopt($curl, CURLOPT_POST, true);curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($data));$response = curl_exec($curl);curl_close($curl);return json_decode($response, true);}?>
分享到:

最新文章