新浪短链接生成源码(t.cn)

<?php
function weibo_url($site){
        $url = 'http://service.weibo.com/share/share.php?url='.urlencode($site).'&title=í颓废ˇsńec&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/10/05/ARTIb5yFeGjgXJvHJx4Z1z0N191005.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']));

版权声明:若无特殊注明,本文作者:颓废,如若转载,请注明出处。

本文链接:新浪短链接生成源码(t.cn) - https://www.0dayhack.com/code/30.html

严重声明:本站内容来自于互联网,仅适于网络安全技术爱好者学习研究使用,学习中请遵循国家相关法律法规,黑客不是骇客,黑客维护网络安全

发表评论

电子邮件地址不会被公开。 必填项已用*标注

联系我们

在线咨询:点击这里给我发消息
邮件:admin@0dayhack.com
工作时间:周一至周五,9:30-18:30,节假日休息