获取 lofter官方背景壁纸代码
获取lofter壁纸的地址,存到数组里面,剩下的步骤自己完成吧!
<?php
$url='http://www.lofter.com/dwr/call/plaincall/ActMiscBean.getLatestIndexImages.dwr';
$post='callCount=1&scriptSessionId=${scriptSessionId}187&c0-scriptName=ActMiscBean&c0-methodName=getLatestIndexImages&c0-id=0&c0-param0=number:100&batchId=126886&';
$referer='http://www.lofter.com/login?urschecked=true';
$rel= get_curl($url,$post,$referer);
preg_match_all('/imageUrl=[\"\'](.*?)[\"\']/i',$rel,$matches);
print_r($matches);
function get_curl($url, $post=0, $referer=0, $cookie=0, $header=0, $ua=0, $nobaody=0){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$httpheader[] = "Accept:application/json";
$httpheader[] = "Accept-Encoding:gzip,deflate,sdch";
$httpheader[] = "Accept-Language:zh-CN,zh;q=0.8";
$httpheader[] = "Connection:close";
curl_setopt($ch, CURLOPT_HTTPHEADER, $httpheader);
if ($post) {
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
}
if ($header) {
curl_setopt($ch, CURLOPT_HEADER, true);
}
if ($cookie) {
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
}
if($referer){
if($referer==1){
curl_setopt($ch, CURLOPT_REFERER, 'http://m.qzone.com/infocenter?g_f=');
}else{
curl_setopt($ch, CURLOPT_REFERER, $referer);
}
}
if ($ua) {
curl_setopt($ch, CURLOPT_USERAGENT, $ua);
}
else {
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Linux; U; Android 4.0.4; es-mx; HTC_One_X Build/IMM76D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0");
}
if ($nobaody) {
curl_setopt($ch, CURLOPT_NOBODY, 1);
}
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$ret = curl_exec($ch);
curl_close($ch);
return $ret;
}
|| 版权声明
作者:大米
链接:https://blog.qqsuu.cn/1581.html
声明:如无特别声明本文即为原创文章仅代表个人观点,版权归《大米博客》所有,欢迎转载,转载请保留原文链接。
作者:大米
链接:https://blog.qqsuu.cn/1581.html
声明:如无特别声明本文即为原创文章仅代表个人观点,版权归《大米博客》所有,欢迎转载,转载请保留原文链接。
THE END
0
二维码
打赏
海报
获取 lofter官方背景壁纸代码
获取lofter壁纸的地址,存到数组里面,剩下的步骤自己完成吧!
<?php
$url='http://www.lofter.com/dwr/call/plaincall/ActMiscBean.getLatestIndexImage……
)">

共有 0 条评论