新浪短网址

发布于 / 未分类 / 3 条评论

<?php
$url=$_GET["url"];
$data = http_get('https://service.weibo.com/share/share.php?url='.$url.'&extra=page%3D1&title=标题');
preg_match_all('/<em class="tag_text">(.*)<\/em>/' , $data , $matches);
print_r($matches[1][0]);
function http_get($url){
    $oCurl = curl_init();
    if(stripos($url,"https://")!==FALSE){
        curl_setopt($oCurl, CURLOPT_SSL_VERIFYPEER, FALSE);
        curl_setopt($oCurl, CURLOPT_SSL_VERIFYHOST, FALSE);
        curl_setopt($oCurl, CURLOPT_SSLVERSION, 1); //CURL_SSLVERSION_TLSv1
    }
    curl_setopt($oCurl, CURLOPT_URL, $url);
    curl_setopt($oCurl, CURLOPT_RETURNTRANSFER, 1 );
    $sContent = curl_exec($oCurl);
    $aStatus = curl_getinfo($oCurl);
    curl_close($oCurl);
    if(intval($aStatus["http_code"])==200){
        return $sContent;
    }else{
        return false;
    }
}

直接利用新浪分享页截取短网址

  1. avatar
  2. avatar

    http://mewkid.net/where-is-xena/ – Amoxicillin On Line 18 evj.hdzf.xhboke.com.fqr.ev http://mewkid.net/where-is-xena/

    1. avatar
      @ucawoyosuvak You are a shit.