<?php
function weibo_url($site){
$url = 'http://service.weibo.com/share/share.php?url='.urlencode($site).'&title=ířÖˇťńČĄ&pic=&appkey=';
set_time_limit(0);
sleep(0.5);
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3314.0 Safari/537.36 SE 2.X MetaSr 1.0');
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt ($ch, CURLOPT_REFERER, "http://news.cctv.com/2019/04/02/ARTIFR5qnxs1fj0v7j3CqXPI190402.shtml");
curl_setopt($ch, CURLOPT_MAXREDIRS,3);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_URL, $url);
$result = curl_exec($ch);
curl_close($ch);
preg_match('#<em class="tag_text">(.*?)<\/em>#' , $result ,$wburl);
return json_encode(['result'=>'ok','url'=>$site,'wb_url'=>$wburl[1],'time'=>time()]);
}
print_r(weibo_url($_GET['url']));
如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!
txttool.com 说一段 esp56物联 查询128 IP查询