/** * * @param $urls 链接地址,数组 array('url1','url2') * @param $siteid 站点id * @param $action 操作方法,推送数据:urls,更新数据:update,删除数据:del */ function baidu_linkpost($urls,$siteid = 1,$action = 'urls') { static $baidu_api; if(empty($baidu_api)) { $baidu_api['sitelist'] = get_cache('sitelist'); foreach ($baidu_api['sitelist'] as $sid=>$r) { $baidu_api['urls'][$sid] = 'http://data.zz.baidu.com/urls?site='.$r['baidu_site'].'&token='.$r['baidu_token']; $baidu_api['update'][$sid] = 'http://data.zz.baidu.com/update?site='.$r['baidu_site'].'&token='.$r['baidu_token']; $baidu_api['del'][$sid] = 'http://data.zz.baidu.com/del?site='.$r['baidu_site'].'&token='.$r['baidu_token']; } } if($baidu_api['sitelist'][$siteid]['baidu_site']=='') { return true; } $baidu_urls = array(); foreach($urls as $url) { if(strpos($url,'://')===false) { $url = $baidu_api['sitelist'][$siteid]['url'].ltrim($url,'/'); } $baidu_urls[] = $url; } $baidu_urls = implode(“\n”, $baidu_urls); $ch = curl_init(); $options = array( CURLOPT_URL => $baidu_api[$action][$siteid], CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_POSTFIELDS => $baidu_urls, CURLOPT_HTTPHEADER => array('Content-Type: text/plain'), ); curl_setopt_array($ch, $options); curl_exec($ch); curl_close($ch); }
]]>- 最新日志
- 热评日志
- 随机日志
- win10.11打印机共享修复工具
- 遥志代-理服务器CCProxy
- Win10安装打印机驱动程序失败提示“试图将驱动程序添加到存储区时遇到问题”解决方法
- 解决银河麒麟系统开机后桌面无图标,只有下方开始菜单和任务栏可操作问题
- Android 9.0 网络权限的问题以及android:usesCleartextTraffic
- 一键修复系统更新造成的打印机无法共享2023.06.15
- 最新版本IDM
- 交换机基本配置命令
- 史上最全华为路由器交换机配置命令大合集
- Linux开关机命令:shutdown,reboot,halt,init之间的区别
提交链接到百度:等您坐沙发呢!