Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
hfpp2012
/
vbot
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit bfaf74df
authored
Mar 13, 2017
by
HanSon
Committed by
GitHub
Mar 13, 2017
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge pull request #48 from HanSon/test-friend
好友数量修复
2 parents
4026f3d0
09bbfbb4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
8 deletions
README.md
composer.json
src/Collections/ContactFactory.php
src/Core/Server.php
README.md
View file @
bfaf74d
...
...
@@ -152,6 +152,16 @@ $robot->server->run();
[
liuwons/wxBot
](
https://github.com/liuwons/wxBot
)
参考了整个微信的登录流程与消息处理
## 贡献者
排名不分先后,时间排序
[
zhuanxuhit
](
https://github.com/zhuanxuhit
)
terminal显示二维码
[
littlecodersh
](
https://github.com/littlecodersh
)
分次加载好友数量方案
[
yuanshi2016
](
https://github.com/yuanshi2016
)
分次加载好友数量方案、登录域名方案以及测试
## 问题和建议
有问题或者建议都可以提issue
...
...
composer.json
View file @
bfaf74d
...
...
@@ -10,9 +10,7 @@
],
"require"
:
{
"guzzlehttp/guzzle"
:
"^6.2"
,
"symfony/dom-crawler"
:
"2.8.*|3.0.*|3.1.*"
,
"endroid/qrcode"
:
"^1.7"
,
"symfony/css-selector"
:
"2.8.*|3.0.*|3.1.*"
,
"pimple/pimple"
:
"^3.0"
,
"illuminate/support"
:
"^5.3"
,
"nesbot/carbon"
:
"^1.21"
,
...
...
src/Collections/ContactFactory.php
View file @
bfaf74d
...
...
@@ -9,6 +9,7 @@
namespace
Hanson\Vbot\Collections
;
use
Hanson\Vbot\Support\Console
;
use
Hanson\Vbot\Support\FileManager
;
class
ContactFactory
...
...
@@ -48,13 +49,15 @@ class ContactFactory
/**
* make instance model
*
*
@param int $seq
*/
public
function
makeContactList
()
public
function
makeContactList
(
$seq
=
0
)
{
$url
=
sprintf
(
server
()
->
baseUri
.
'/webwxgetcontact?pass_ticket=%s&skey=%s&r=%s
'
,
server
()
->
passTicket
,
server
()
->
skey
,
time
()
);
$url
=
sprintf
(
server
()
->
baseUri
.
'/webwxgetcontact?pass_ticket=%s&skey=%s&r=%s
&seq=%s'
,
server
()
->
passTicket
,
server
()
->
skey
,
time
(),
$seq
);
$memberList
=
http
()
->
json
(
$url
,
[],
true
)[
'MemberList'
];
$result
=
http
()
->
json
(
$url
,
[],
true
);
$memberList
=
$result
[
'MemberList'
];
$seq
=
$result
[
'Seq'
];
foreach
(
$memberList
as
$contact
)
{
if
(
official
()
->
isOfficial
(
$contact
[
'VerifyFlag'
])){
#公众号
...
...
@@ -67,6 +70,10 @@ class ContactFactory
contact
()
->
put
(
$contact
[
'UserName'
],
$contact
);
}
}
if
(
$seq
!=
0
){
$this
->
makeContactList
(
$seq
);
}
}
/**
...
...
src/Core/Server.php
View file @
bfaf74d
...
...
@@ -178,8 +178,8 @@ class Server
$this
->
redirectUri
=
$matches
[
1
]
.
'&fun=new'
;
$domainList
=
[
'wx2.qq.com'
=>
[
'file.wx2.qq.com'
,
'webpush.wx2.qq.com'
],
'wx.qq.com'
=>
[
'file.wx.qq.com'
,
'webpush.wx.qq.com'
],
'wx8.qq.com'
=>
[
'file.wx8.qq.com'
,
'webpush.wx8.qq.com'
],
'wx.qq.com'
=>
[
'file.wx.qq.com'
,
'webpush.wx.qq.com'
],
'web2.wechat.com'
=>
[
'file.web2.wechat.com'
,
'webpushweb2.wechat.com'
],
'wechat.com'
=>
[
'file.web.wechat.com'
,
'webpushweb.web.wechat.com'
],
];
...
...
@@ -191,11 +191,13 @@ class Server
$this
->
baseUri
=
sprintf
(
$url
,
$domain
);
$this
->
domain
=
$domain
;
break
;
}
else
{
$this
->
fileUri
=
$this
->
pushUri
=
$this
->
redirectUri
;
}
}
return
;
case
'408'
:
Console
::
log
(
'登录超时,请重试'
,
Console
::
ERROR
);
Console
::
log
(
'登录超时,请重试'
,
Console
::
WARNING
);
$tip
=
1
;
$retryTime
-=
1
;
sleep
(
1
);
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment