新浪短链接生成源码(t.cn) - 黑帽SEO

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

  • 内容
  • 相关
<?php
function weibo_url($site){
        $url = 'http://service.weibo.com/share/share.php?url='.urlencode($site).'&title=í&#39059;&#24223;ˇ&#115;ń&#101;&#99;&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) - http://www.weixingseo.com/post-171.html

发表评论

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