Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wechat
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenweiyang
wechat
Commits
15b42959
Commit
15b42959
authored
Oct 29, 2019
by
zhiwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改高级搜索功能失效问题
parent
50a50f32
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
8 deletions
+12
-8
pom.xml
+1
-1
src/main/java/com/zhiwei/wechat/search/WechatAritcleSearch.java
+9
-6
src/test/java/com/zhiwei/wechat/example/WechatSearchExample.java
+2
-1
No files found.
pom.xml
View file @
15b42959
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<modelVersion>
4.0.0
</modelVersion>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.zhiwei
</groupId>
<groupId>
com.zhiwei
</groupId>
<artifactId>
wechat
</artifactId>
<artifactId>
wechat
</artifactId>
<version>
1.
1.8
-SNAPSHOT
</version>
<version>
1.
2.0
-SNAPSHOT
</version>
<description>
<description>
知微微信采集程序,包含
知微微信采集程序,包含
1.微信历史文章采集
1.微信历史文章采集
...
...
src/main/java/com/zhiwei/wechat/search/WechatAritcleSearch.java
View file @
15b42959
...
@@ -72,12 +72,15 @@ public class WechatAritcleSearch {
...
@@ -72,12 +72,15 @@ public class WechatAritcleSearch {
boolean
f
=
true
;
boolean
f
=
true
;
int
page
=
1
;
int
page
=
1
;
while
(
f
)
{
while
(
f
)
{
String
searchUrl
=
"http://weixin.sogou.com/weixin?type=2&query="
+
URLEncoder
.
encode
(
word
,
"UTF-8"
)
String
searchUrl
=
"https://weixin.sogou.com/weixin?type=2&s_from=input&query="
+
URLEncoder
.
encode
(
word
,
"UTF-8"
)+
"&ie=utf8&_sug_=n&_sug_type_=&page="
+
page
;
+
"&ie=utf8&_sug_=n&_sug_type_=&ri=1&sourceid=sugg&sst0="
+
System
.
currentTimeMillis
()
+
"&tsn="
+
tsn
+
"&page="
+
page
;
// String searchUrl = "http://weixin.sogou.com/weixin?type=2&query=" + URLEncoder.encode(word, "UTF-8")
if
(
tsn
==
5
)
{
// + "&ie=utf8&_sug_=n&_sug_type_=&ri=1&sourceid=sugg&sst0=" + System.currentTimeMillis()
searchUrl
=
searchUrl
+
"&ft="
+
startTime
+
"&et="
+
endTime
+
"&wxid=&usip=&interation=&from=tool"
;
// + "&tsn=" + tsn + "&page=" + page;
}
// if (tsn == 5) {
// searchUrl = searchUrl + "&ft=" + startTime + "&et=" + endTime + "&wxid=&usip=&interation=&from=tool";
// }
System
.
out
.
println
(
searchUrl
);
headerMap
.
put
(
"Referer"
,
searchUrl
);
headerMap
.
put
(
"Referer"
,
searchUrl
);
// 获取数据
// 获取数据
String
htmlBody
=
httpBoot
.
syncCall
(
RequestUtils
.
wrapGet
(
searchUrl
,
headerMap
),
proxy
,
false
).
body
().
string
();
String
htmlBody
=
httpBoot
.
syncCall
(
RequestUtils
.
wrapGet
(
searchUrl
,
headerMap
),
proxy
,
false
).
body
().
string
();
...
...
src/test/java/com/zhiwei/wechat/example/WechatSearchExample.java
View file @
15b42959
...
@@ -41,6 +41,7 @@ public class WechatSearchExample{
...
@@ -41,6 +41,7 @@ public class WechatSearchExample{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
ProxyFactory
.
init
(
registry
,
group
,
GroupType
.
PROVIDER
,
10000018
);
ProxyFactory
.
init
(
registry
,
group
,
GroupType
.
PROVIDER
,
10000018
);
proxy
=
ProxyHolder
.
SOUGOU_INNER_PROXY
.
getProxy
();
proxy
=
ProxyHolder
.
SOUGOU_INNER_PROXY
.
getProxy
();
try
{
try
{
WechatSearchExample
.
wechatSearchExample
();
WechatSearchExample
.
wechatSearchExample
();
}
catch
(
UnknownHostException
e
)
{
}
catch
(
UnknownHostException
e
)
{
...
@@ -56,7 +57,7 @@ public class WechatSearchExample{
...
@@ -56,7 +57,7 @@ public class WechatSearchExample{
for
(
String
word
:
wordList
)
for
(
String
word
:
wordList
)
{
{
try
{
try
{
List
<
WechatAricle
>
list
=
WechatAritcleSearch
.
wechatKeywordSearch
(
word
,
5
,
null
,
"2019-10-28"
,
"2019-10-28"
,
proxy
,
51
);
List
<
WechatAricle
>
list
=
WechatAritcleSearch
.
wechatKeywordSearch
(
word
,
5
,
null
,
"2019-10-28"
,
"2019-10-28"
,
proxy
,
2
);
System
.
out
.
println
(
"======"
+
list
.
size
());
System
.
out
.
println
(
"======"
+
list
.
size
());
for
(
WechatAricle
wechat
:
list
){
for
(
WechatAricle
wechat
:
list
){
System
.
out
.
println
(
wechat
.
getId
());
System
.
out
.
println
(
wechat
.
getId
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment