<?php /**************** * **为你一人 2cbk.com **记忆时光|二超博客整理制作 * *****************/ header("content-type:text/html; charset=utf-8"); function cpost($url,$post){ $ch= curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1); curl_setopt($ch, CURLOPT_USERAGENT, ’Mozilla/5.0 (Linux; U; Android 4.4.1; zh-cn; R815T Build/JOP40D) AppleWebKit/533.1 (KHTML, like Gecko)Version/4.0 MQQBrowser/4.5 Mobile Safari/533.1’); curl_setopt($ch, CURLOPT_AUTOREFERER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); curl_setopt($ch, CURLOPT_TIMEOUT, 30); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); curl_close($ch); return $result; } function surl($content="wnyr",$sid,$qq,$sname,$richval,$lon="",$lat=""){ $url=’http://m.qzone.com/mood/publish_mood’; $post=’content=’.$content.’++&sid=’.$sid.’&lon=’.$lon.’&lbsid=&res_uin=’.$qq.’&richval=’.urlencode($richval).’&source_name=’.$sname.’&is_winphone=2&opr_type=publish_shuoshuo&format=json&issyncweibo=0&lat=’.$lat; return cpost($url,$post); } echo <<<HTML <html> <body> <form action="qzone.php" method="post" enctype="multipart/form-data"> QQ<input type="text" name="qq"><br> SID<input type="text" name="sid"><br> 机型<input type="text" name="sname" value="iPhone6 Plus"><br> 内容<input type="text" name="content" value="来自为你一人"><br> 经度lon<input type="text" name="lon"><br> 纬度lat<input type="text" name="lat"><br> <label for="file">上传图片:</label> <input type="file" name="file" id="file" /> <br /> <input type="submit" name="submit" value="发布" /> </form> </body> </html> HTML; $qq=$_POST["qq"]; $sid=$_POST["sid"]; $sname=$_POST["sname"]; $content=$_POST["content"]; $lon=$_POST["lon"]; $lat=$_POST["lat"]; if((!empty($sid))&&(!empty($qq))){ $file = realpath($_FILES["file"]["tmp_name"]); $image_size = getimagesize($file); $image=file_get_contents($file); $url="http://up.qzone.com/cgi-bin/upload/cgi_upload_pic_v2"; $post="picture=".urlencode(base64_encode($image))."&base64=1&hd_height=".$image_size[1]."&hd_width=".$image_size[0]."&hd_quality=90&output_type=json&preupload=1&charset=utf-8&output_charset=utf-8&logintype=sid&Exif_CameraMaker=&Exif_CameraModel=&Exif_Time=&uin=".$qq."&sid=".$sid; $data=preg_replace("/s/","",cpost($url,$post)); preg_match(’/_Callback((.*));/’,$data,$arr); $data=json_decode($arr[1],true); $post="output_type=json&preupload=2&md5=".$data[filemd5]."&filelen=".$data[filelen]."&batchid=".time().rand(100000,999999)."&currnum=0&uploadNum=1&uploadtime=".time()."&uploadtype=1&upload_hd=0&albumtype=7&big_style=1&op_src=15003&charset=utf-8&output_charset=utf-8&uin=".$qq."&sid=".$sid."&logintype=sid&refer=shuoshuo"; $img=preg_replace("/s/","",cpost($url,$post)); preg_match(’/_Callback([(.*)]);/’,$img,$arr); $data=json_decode($arr[1],true); $richval="{$data[picinfo][albumid]},{$data[picinfo][lloc]},{$data[picinfo][sloc]},{$data[picinfo][type]},{$data[picinfo][height]},{$data[picinfo][width]},,,"; $result=surl($content,$sid,$qq,$sname,$richval,$lon,$lat); $result=json_decode($result,true); if($result[code]==0) echo "发布成功"; else echo "发布异常"; }
演示地址:http://wap.wnyr.pw/qzone.php
|?・ω・)ノ博主,请问一下 http://wap.wnyr.pw/qzone.php 这个页面的源码可以给我吗?直接用这个php文件界面不怎么美观。。原谅我这个伸手党,谢谢啦~~
@DIYgod:没注意。。那个页面不是你的。。。打扰了。。。
@DIYgod:这些源码我有在博客分享过的。亲