首页
友人帐
留言板
关于
Search
1
IDE Eval Resetter:JetBrains 全家桶无限试用插件
385 阅读
2
影视资源采集站收录大全
316 阅读
3
linux安装或升级protoc
226 阅读
4
VFM 3.7.5 源码 - 一个极简的 PHP 私人云盘!
165 阅读
5
批量采集美女写真等图片做图片站
151 阅读
谈天说地
程序源码
技术教程
成品源码
登录
Search
标签搜索
PHP
linux
源码
go
windows
centos
原创
mysql
微信
激活
采集
宝塔
绿色版
API
解析
SDK
图片
破解
域名
html
云青
累计撰写
150
篇文章
累计收到
88
条评论
首页
栏目
谈天说地
程序源码
技术教程
成品源码
页面
友人帐
留言板
关于
搜索到
40
篇与
的结果
2019-07-03
2019最新云豹直播采集(各大平台)
应客户需求写了一个直播采集插件功能主要就是采集各平台直播入自己库并生成僵尸粉下载链接在下方云豹直播主播采集插件.zip
2019年07月03日
14 阅读
2 评论
0 点赞
2019-04-22
PHP实现微博登入(非开放平台)
用到官方的两个接口,一个是获取图片地址以及qrid,一个是用qrid验证二维码状态获取新浪登入二维码 public function getqrpic() { $url = "https://login.sina.com.cn/sso/qrcode/image?entry=weibo&size=180&callback=STK_" . $this->getTime(); $header = [ 'Accept:' => '*/*', 'Accept-Encoding:' => 'gzip, deflate, br', 'Accept-Language:' => 'en-US,en;q=0.9', 'Connection:' => 'keep-alive', 'Cookie:' => 'mm_lang=en; mm_lang=en', 'Host:' => 'login.wx.qq.com', 'Referer:' => 'https://wx.qq.com/', 'User-Agent:' => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36' ]; $res = Curl::url($url)->setHeader($header)->get(); $regex = "#window(.*?)\(#"; $resArr = json_decode(rtrim(rtrim(preg_replace($regex, "", $res), ';'), ')'), true); // echo ltrim($resArr['data']['image'], '//'); if ($resArr['retcode'] == 20000000) { Json::msg(0, 'success', ['qrid' => $resArr['data']['qrid'], 'image' => 'https://' . ltrim($resArr['data']['image'], '//')]); } else { Json::msg(1, '二维码获取失败'); } }利用返回的qrid验证二维码状态 public function cron() { if (input('?get.qrid')) { $qrid = input('get.qrid'); } else { Json::msg(400, 'qrid不能为空'); } $url = "https://login.sina.com.cn/sso/qrcode/check?entry=weibo&qrid=" . $qrid . "&callback=STK_" . $this->getTime(); // echo $url;exit; $header = [ 'Accept:' => '*/*', 'Accept-Encoding:' => 'gzip, deflate, br', 'Accept-Language:' => 'en-US,en;q=0.9', 'Connection:' => 'keep-alive', 'Cookie:' => 'mm_lang=en; mm_lang=en', 'Host:' => 'login.wx.qq.com', 'Referer:' => 'https://wx.qq.com/', 'User-Agent:' => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36' ]; $res = Curl::url($url)->setHeader($header)->get(); $regex = "#window(.*?)\(#"; $resArr = json_decode(rtrim(rtrim(preg_replace($regex, "", $res), ';'), ')'), true); if($resArr['retcode'] == 50114003){ Json::msg(205, '二维码已失效'); } elseif($resArr['retcode'] == 50114001) { Json::msg(202, '二维码未失效'); } elseif($resArr['retcode'] == 50114002) { Json::msg(204, '正在验证二维码'); } elseif ($resArr['retcode'] == 50114004) { Json::msg(204, '该二维码已登录,请重新扫描'); } elseif ($resArr['retcode'] == 20000000) { //Json::msg(200, 'sucess', $resArr); preg_match("/-(.*?)-/", $resArr['data']['alt'], $ts_arr); $wb = base64_decode($ts_arr[1]); // 这里写成功后的操作 // 扫码成功后会返回一个固定的base64,利用这个值登入吧 $this->reg($wb); } else{ Json::msg(306, $res); } }附getTime方法,此方法获取13位时间戳 private function getTime() { $arr = explode('.', microtime(true)); return (float)($arr[0] . substr($arr[1], 0 , 3)); }前端代码博主就不贴了,定时器罢了示例网站:http://www.chinawenshu.com
2019年04月22日
13 阅读
0 评论
0 点赞
2019-04-18
PHP实现QQ扫码登入,非开放平台
近期有个需求,需要做扫码登入,而又不想去开放平台申请,看了一下彩虹大神的提取qq的sid,提取了几个重要的方法原理就是生成二维码后,前端设置定时器查看二维码状态,因为没有openid只能保存固定的值,那就是qq号了 // 生成二维码 public function getqrpic() { $url = 'https://ssl.ptlogin2.qq.com/ptqrshow?appid=1006102&e=2&l=M&s=4&d=72&v=4&t=0.5409099' . time() . 'daid=1&pt_3rd_aid=0'; $arr = $this->get_curl($url, 0, 0, 0, 1, 0, 0, 1); preg_match('/qrsig=(.*?);/', $arr['header'], $match); if ($qrsig = $match[1]) { Json::msg(0, 'success', ['qrsig' => $qrsig, 'data' => base64_encode($arr['body'])]); } else { Json::msg(1, '二维码获取失败'); } } // 获取二维码状态 public function qqlogin() { error_reporting(0); if (input('?get.qrsig')) { $qrsig = input('get.qrsig'); } else { Json::msg(400, 'qrsig不能为空'); } $sig = ''; $url = 'https://ssl.ptlogin2.qq.com/ptqrlogin?u1=https%3A%2F%2Fid.qq.com%2Findex.html&ptqrtoken=' . $this->getqrtoken($qrsig) . '&ptredirect=1&h=1&t=1&g=1&from_ui=1&ptlang=2052&action=0-0-' . time() . '0000&js_ver=10291&js_type=1&login_sig=' . $sig . '&pt_uistyle=40&aid=1006102&daid=1&'; $ret = $this->get_curl($url, 0, $url, 'qrsig=' . $qrsig . '; ', 1); preg_match("/ptuiCB\('(.*?)'\)/", $ret, $ts_arr); $r = @explode("','", str_replace("', '", "','", $ts_arr[1])); if ($r[0] == 65) { Json::msg(205, '二维码已失效'); } elseif ($r[0] == 66) { Json::msg(202, '二维码未失效'); } elseif ($r[0] == 67) { Json::msg(204, '正在验证二维码'); } else { if (strpos($ret, '403')) Json::msg(306, $ret); } if (strlen($ret) > 1000) { $arr = explode(';', $ret); $data = substr($arr[17], strpos($arr[17], '=o') + 2, strlen($arr[17])); if (empty($data)) { Json::msg(400, '请切换二维码' . $ret); } $qq = ltrim($data, '0'); // $qq是qq号,下面写你接下来需要处理的语句 } } private function get_curl($url, $post = 0, $referer = 0, $cookie = 0, $header = 0, $ua = 0, $nobaody = 0, $split = 0) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); $httpheader[] = "Accept:*/*"; $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) { curl_setopt($ch, CURLOPT_REFERER, $referer); } if ($ua) { curl_setopt($ch, CURLOPT_USERAGENT, $ua); } else { curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.152 Safari/537.36'); } if ($nobaody) { curl_setopt($ch, CURLOPT_NOBODY, 1); } curl_setopt($ch, CURLOPT_ENCODING, "gzip"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $ret = curl_exec($ch); if ($split) { $headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE); $header = substr($ret, 0, $headerSize); $body = substr($ret, $headerSize); $ret = array(); $ret['header'] = $header; $ret['body'] = $body; } curl_close($ch); return $ret; }前端js getqrpic(); function getqrpic() { var getvcurl = "qlogin/getqrpic/r/" + Math.random(1); $.get(getvcurl, function (res) { console.log(res.info.qrsig) if (res.status == 0) { $('#qrimg').attr('qrsig', res.info.qrsig); $('#qrimg').html('<img onclick="getqrpic()" src="data:image/png;base64,' + res.info.data + '" title="点击刷新">'); } else { //alert(res.msg); } }, 'json'); } $(document).ready(function(){ interval1=setInterval(getMsg,2000); }); function getMsg() { var qrsig=$('#qrimg').attr('qrsig'); var getvcurl = "qlogin/qqlogin/qrsig/" + decodeURIComponent(qrsig) + '/r/' + Math.random(1); $.get(getvcurl, function (res) { if (res.status == 200) { // 这里写登入过后你执行的语句 } else if (res.status == 205 || res.status == 306) { getqrpic(); } else { } }, 'json'); }示例网站:http://www.chinawenshu.com
2019年04月18日
16 阅读
3 评论
0 点赞
2019-04-03
分享一个PHP环信服务端操作类
之前做直播系统,需要用到通信这一块,由于官方文档没有sdk,博主本人也是google的,顺便修改了一下 <?php namespace hx; class Hx { private $app_key = '1106196338107043#bfzb'; private $client_id = 'YXA68gwqIDr4Eem08DO8sr_xCA'; private $client_secret = 'YXA57if_NzYCtL_96DktWsvILrlcU24'; private $url = "https://a1.easemob.com/1106190228107043/bfzb"; /* * 获取APP管理员Token */ public function __construct() { $url = $this->url . "/token"; $data = array( 'grant_type' => 'client_credentials', 'client_id' => $this->client_id, 'client_secret' => $this->client_secret ); $rs = json_decode($this->curl($url, $data), true); $this->token = $rs['access_token']; } /* * 注册IM用户(授权注册) */ public function hx_register($username, $password, $nickname) { $url = $this->url . "/users"; $data = array( 'username' => $username, 'password' => $password, 'nickname' => $nickname ); $header = array( 'Content-Type: application/json', 'Authorization: Bearer ' . $this->token ); return $this->curl($url, $data, $header, "POST"); } /* * 给IM用户的添加好友 */ public function hx_contacts($owner_username, $friend_username) { $url = $this->url . "/users/${owner_username}/contacts/users/${friend_username}"; $header = array( 'Authorization: Bearer ' . $this->token ); return $this->curl($url, "", $header, "POST"); } /* * 解除IM用户的好友关系 */ public function hx_contacts_delete($owner_username, $friend_username) { $url = $this->url . "/users/${owner_username}/contacts/users/${friend_username}"; $header = array( 'Authorization: Bearer ' . $this->token ); return $this->curl($url, "", $header, "DELETE"); } /* * 查看好友 */ public function hx_contacts_user($owner_username) { $url = $this->url . "/users/${owner_username}/contacts/users"; $header = array( 'Authorization: Bearer ' . $this->token ); return $this->curl($url, "", $header, "GET"); } /* 发送文本消息 */ public function hx_send($sender, $receiver, $msg) { $url = $this->url . "/messages"; $header = array( 'Authorization: Bearer ' . $this->token ); $data = array( 'target_type' => 'users', 'target' => array( '0' => $receiver ), 'msg' => array( 'type' => "txt", 'msg' => $msg ), 'from' => $sender, 'ext' => array( 'attr1' => 'v1', 'attr2' => "v2" ) ); return $this->curl($url, $data, $header, "POST"); } /* 查询离线消息数 获取一个IM用户的离线消息数 */ public function hx_msg_count($owner_username) { $url = $this->url . "/users/${owner_username}/offline_msg_count"; $header = array( 'Authorization: Bearer ' . $this->token ); return $this->curl($url, "", $header, "GET"); } /* * 获取IM用户[单个] */ public function hx_user_info($username) { $url = $this->url . "/users/${username}"; $header = array( 'Authorization: Bearer ' . $this->token ); return $this->curl($url, "", $header, "GET"); } /* * 获取IM用户[批量] */ public function hx_user_infos($limit) { $url = $this->url . "/users?${limit}"; $header = array( 'Authorization: Bearer ' . $this->token ); return $this->curl($url, "", $header, "GET"); } /* * 重置IM用户密码 */ public function hx_user_update_password($username, $newpassword) { $url = $this->url . "/users/${username}/password"; $header = array( 'Authorization: Bearer ' . $this->token ); $data['newpassword'] = $newpassword; return $this->curl($url, $data, $header, "PUT"); } /* * 删除IM用户[单个] */ public function hx_user_delete($username) { $url = $this->url . "/users/${username}"; $header = array( 'Authorization: Bearer ' . $this->token ); return $this->curl($url, "", $header, "DELETE"); } /* * 修改用户昵称 */ public function hx_user_update_nickname($username, $nickname) { $url = $this->url . "/users/${username}"; $header = array( 'Authorization: Bearer ' . $this->token ); $data['nickname'] = $nickname; return $this->curl($url, $data, $header, "PUT"); } /* * * curl */ private function curl($url, $data, $header = false, $method = "POST") { $ch = curl_init($url); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); if ($header) { curl_setopt($ch, CURLOPT_HTTPHEADER, $header); } curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); if ($data) { curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); } curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); $ret = curl_exec($ch); return $ret; } } $rs = new Hx(); // 注册的用户 echo $rs->hx_register('qwerasd', 'qazwsx', '福州123'); // 给IM用户的添加好友 // echo $rs->hx_contacts('admin888', 'qwerasd'); /* 发送文本消息 */ // echo $rs->hx_send('213123','admin888','dfadsr214wefaedf'); /* 消息数统计 */ // echo $rs->hx_msg_count('admin888'); /* 获取IM用户[单个] */ // echo $rs->hx_user_info('admin888'); /* 获取IM用户[批量] */ // echo $rs->hx_user_infos('20'); /* 删除IM用户[单个] */ // echo $rs->hx_user_delete('wwwwww'); /* 修改用户昵称 */ // echo $rs->hx_user_update_nickname('asaxcfasdd','网络科技'); /* 重置IM用户密码 */ // echo $rs->hx_user_update_password('asaxcfasdd','asdad'); /* 解除IM用户的好友关系 */ // echo $rs->hx_contacts_delete('admin888', 'qqqqqqqq'); /* 查看好友 */ //echo $rs->hx_contacts_user('admin888');
2019年04月03日
15 阅读
2 评论
0 点赞
2019-01-27
必应获取每日高清壁纸API代码
话不多说直接上代码 <?php $str = file_get_contents('http://cn.bing.com/HPImageArchive.aspx?idx=0&n=1'); if (preg_match("/<url>(.+?)<\/url>/ies", $str, $matches)) { $imgurl = 'http://cn.bing.com' . $matches[1]; } else { $imgurl = '修改为你自己的默认图片地址'; } header("Location: $imgurl");
2019年01月27日
2 阅读
0 评论
0 点赞
1
...
3
4
5
...
8