Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weibohotcrawler
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
weibohotcrawler
Commits
a6153b6e
Commit
a6153b6e
authored
Apr 19, 2019
by
[zhangzhiwei]
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
升级采集核心包
parent
650be1b5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
pom.xml
+3
-3
src/main/java/com/zhiwei/weibocrawler/httpclient/HttpClientDemo.java
+5
-2
No files found.
pom.xml
View file @
a6153b6e
...
@@ -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>
weibohotcrawler
</artifactId>
<artifactId>
weibohotcrawler
</artifactId>
<version>
0.0.
4
-SNAPSHOT
</version>
<version>
0.0.
5
-SNAPSHOT
</version>
<name>
weibohotcrawler
</name>
<name>
weibohotcrawler
</name>
<description>
微博热搜1小时榜单,社会、热点采集程序
</description>
<description>
微博热搜1小时榜单,社会、热点采集程序
</description>
...
@@ -29,14 +29,14 @@
...
@@ -29,14 +29,14 @@
<dependency>
<dependency>
<groupId>
com.zhiwei.tools
</groupId>
<groupId>
com.zhiwei.tools
</groupId>
<artifactId>
zhiwei-tools
</artifactId>
<artifactId>
zhiwei-tools
</artifactId>
<version>
0.1.
1
-SNAPSHOT
</version>
<version>
0.1.
3
-SNAPSHOT
</version>
<scope>
provided
</scope>
<scope>
provided
</scope>
</dependency>
</dependency>
<dependency>
<dependency>
<groupId>
com.zhiwei.crawler
</groupId>
<groupId>
com.zhiwei.crawler
</groupId>
<artifactId>
crawler-core
</artifactId>
<artifactId>
crawler-core
</artifactId>
<version>
0.
1.1
-RELEASE
</version>
<version>
0.
3.6
-RELEASE
</version>
<scope>
provided
</scope>
<scope>
provided
</scope>
</dependency>
</dependency>
</dependencies>
</dependencies>
...
...
src/main/java/com/zhiwei/weibocrawler/httpclient/HttpClientDemo.java
View file @
a6153b6e
...
@@ -6,11 +6,14 @@ import java.util.Map;
...
@@ -6,11 +6,14 @@ import java.util.Map;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
com.zhiwei.tools.httpclient.HttpClientTemplateOK
;
import
com.zhiwei.crawler.core.HttpBoot
;
import
com.zhiwei.crawler.utils.RequestUtils
;
public
class
HttpClientDemo
{
public
class
HttpClientDemo
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
HttpClientDemo
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
HttpClientDemo
.
class
);
private
static
HttpBoot
httpBoot
=
new
HttpBoot
.
Builder
().
retryTimes
(
3
).
build
();
public
static
String
executeHttpRequestGet
(
String
url
)
{
public
static
String
executeHttpRequestGet
(
String
url
)
{
String
result
=
null
;
String
result
=
null
;
...
@@ -25,7 +28,7 @@ public class HttpClientDemo {
...
@@ -25,7 +28,7 @@ public class HttpClientDemo {
try
{
try
{
// Response response = HttpBoot.syncCall(RequestUtils.wrapGet(url, headerMap));
// Response response = HttpBoot.syncCall(RequestUtils.wrapGet(url, headerMap));
// result = response.body().string();
// result = response.body().string();
result
=
HttpClientTemplateOK
.
get
(
url
,
null
,
headerMap
);
result
=
httpBoot
.
syncCall
(
RequestUtils
.
wrapGet
(
url
,
headerMap
)).
body
().
string
(
);
return
result
;
return
result
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
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