实例介绍
【实例简介】
【实例截图】
【核心代码】
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | <html> <head> <meta charset= "UTF-8" > <title>百度贴吧一键签到 by Gardel</title> </head> <body> <?php date_default_timezone_set( 'PRC' ); set_time_limit(0); /*定义自定义函数*/ function xCurl( $url , $cookie =null, $postdata =null, $header = array ()){ $ch = curl_init(); curl_setopt( $ch , CURLOPT_URL, $url ); if (! is_null ( $postdata )) curl_setopt( $ch , CURLOPT_POSTFIELDS, $postdata ); if (! is_null ( $cookie )) curl_setopt( $ch , CURLOPT_COOKIE, $cookie ); if (! empty ( $header )) curl_setopt( $ch , CURLOPT_HTTPHEADER, $header ); curl_setopt( $ch , CURLOPT_SSL_VERIFYPEER, false); curl_setopt( $ch , CURLOPT_RETURNTRANSFER, 1); curl_setopt( $ch , CURLOPT_TIMEOUT, 50); $re = curl_exec( $ch ); curl_close( $ch ); return $re ; }; /*定义变量*/ $tieba_header = array ( 'Content-Type: application/x-www-form-urlencoded' , 'Charset: UTF-8' , 'net: 3' , 'User-Agent: bdtb for Android 8.4.0.1' , 'Connection: Keep-Alive' , 'Accept-Encoding: gzip' , 'Host: c.tieba.baidu.com' , ); $firefox_header = array ( 'Host: tieba.baidu.com' , 'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0' , 'Accept: */*' , 'Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3' , 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' , 'Connection: keep-alive' , ); /*传输post*/ if (isset( $_POST [ 'bduss' ])) $bduss = trim( $_POST [ 'bduss' ], " \t=\"\'" ); elseif (isset( $_GET [ 'bduss' ])) $bduss = trim( $_GET [ 'bduss' ], " \t\"\'" ); else { echo '<form action="' . substr ( $_SERVER [ 'PHP_SELF' ], strrpos ( $_SERVER [ 'PHP_SELF' ], '/' ) 1). '" method="post">BDUSS:<input type="text" name="bduss" /><input type="submit" value="一键签到" /></form><p>按下签到按钮签到,可能有些卡,请耐心等待哦</p>' ; goto msign_end; }; $re =json_decode(xCurl( 'http://tieba.baidu.com/dc/common/tbs' , 'BDUSS=' . $bduss ,null, $firefox_header ),true); if (! $re [ 'is_login' ]) { echo '<a>登录失败,点此</a><a href="' . substr ( $_SERVER [ 'PHP_SELF' ], strrpos ( $_SERVER [ 'PHP_SELF' ], '/' ) 1). '">返回</a>' ; goto msign_end; }; $tbs = $re [ 'tbs' ]; /*程序开始*/ $postdata = array ( 'BDUSS=' . $bduss , 'tbs=' . $tbs ); $postdata = implode( '&' , $postdata ). '&sign=' .md5(implode( '' , $postdata ). 'tiebaclient!!!' ); $re = json_decode(gzdecode(xCurl( 'http://c.tieba.baidu.com/c/c/forum/msign' , 'ca=open' , $postdata , $tieba_header )),true); if ( $re [ 'error_code' ] == '0' ) echo '<a>默认签成功,执行第二次签到。</a><p />' ; else echo '<a>默认签到出错,使用超级签到。</a><p />' ; $re = json_decode(xCurl( 'http://tieba.baidu.com/tbmall/onekeySignin1' , 'BDUSS=' . $bduss , 'ie=utf-8&tbs=' . $tbs , $firefox_header ),true); if (@ $re [ 'data' ][ 'unsignedForumAmount' ] == '0' ){ echo '<a>签到完成!已签' . @ $re [ 'data' ][ 'signedForumAmount' ] . '个吧,' . @ $re [ 'data' ][ 'unsignedForumAmount' ] . '个吧未签。</a>' ; goto msign_end; } for ( $pageno = 1; 1 ; $pageno ){ $postdata = 'BDUSS=' .urlencode( $bduss ). '&_client_version=8.1.0.4' . '&page_no=' . $pageno . '&page_size=100' . '&sign=' .md5( 'BDUSS=' . $bduss . '_client_version=8.1.0.4' . 'page_no=' . $pageno . 'page_size=100' . 'tiebaclient!!!' ); $re = json_decode(gzdecode(xCurl( 'http://c.tieba.baidu.com/c/f/forum/like' , 'ca=open' , $postdata , $tieba_header )),true); foreach ( $re [ 'forum_list' ][ 'non-gconforum' ] as $list ) { echo '<a>尝试签到“' . $list [ 'name' ]. '吧”:' ; $re_o = json_decode(gzdecode(xCurl( 'http://c.tieba.baidu.com/c/c/forum/sign' , 'ca=open' , 'BDUSS=' .urlencode( $bduss ). '&fid=' . $list [ 'id' ]. '&kw=' .urlencode( $list [ 'name' ]). '&sign=' .md5( 'BDUSS=' . $bduss . 'fid=' . $list [ 'id' ]. 'kw=' . $list [ 'name' ]. 'tbs=' . $tbs . 'tiebaclient!!!' ). '&tbs=' . $tbs , $tieba_header )),true); if ( $re_o [ 'error_code' ] == '0' ) echo '签到完成,经验值加' . $re_o [ 'user_info' ][ 'sign_bonus_point' ] . ',你是今天第' . $re_o [ 'user_info' ][ 'user_sign_rank' ] . '个签到的。</a><br />' ; else echo '<a>' . $re_o [ 'error_msg' ] . '。</a><br />' ; }; if ( $re [ 'has_more' ] == '0' ) break ; }; $re = json_decode(xCurl( 'http://tieba.baidu.com/tbmall/onekeySignin1' , 'BDUSS=' . $bduss , 'ie=utf-8&tbs=' . $tbs , $firefox_header ),true); echo '<a>签到完成!已签' . @ $re [ 'data' ][ 'signedForumAmount' ] . '个吧,' . @ $re [ 'data' ][ 'unsignedForumAmount' ] . '个吧未签。</a>' ; msign_end: echo '<br /><a>' . date ( 'Y年m月d日 H:i:s' ). '</a><br />' ; ?> </body> </html> |
好例子网口号:伸出你的我的手 — 分享!
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论