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
fc0b457a
Commit
fc0b457a
authored
Aug 22, 2019
by
zhiwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改为新版去重
parent
092f98d7
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 additions
and
55 deletions
+1
-55
pom.xml
+1
-0
src/main/java/com/zhiwei/weibocrawler/rsidClient/RsidClientDAO.java
+0
-55
No files found.
pom.xml
View file @
fc0b457a
...
...
@@ -38,6 +38,7 @@
<groupId>
com.zhiwei.middleware
</groupId>
<artifactId>
cleaner-unified-filter
</artifactId>
<version>
1.0.1.RELEASE
</version>
<scope>
provided
</scope>
</dependency>
</dependencies>
...
...
src/main/java/com/zhiwei/weibocrawler/rsidClient/RsidClientDAO.java
deleted
100644 → 0
View file @
092f98d7
package
com
.
zhiwei
.
weibocrawler
.
rsidClient
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
com.zhiwei.common.config.GroupType
;
import
com.zhiwei.middleware.cleaner.urlfilter.UnifiedUrlFilterClientNew
;
import
com.zhiwei.tools.tools.ZhiWeiTools
;
import
com.zhiwei.weibocrawler.config.Config
;
/**
* @ClassName RsidClientDAO
* @Description 验证数据重复类
* @author byte-zbs
* @Date 2017年12月6日 下午5:21:15
* @version 1.0.0
*/
public
class
RsidClientDAO
{
private
static
UnifiedUrlFilterClientNew
client
;
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
RsidClientDAO
.
class
);
static
{
if
(
client
==
null
){
synchronized
(
RsidClientDAO
.
class
)
{
if
(
client
==
null
)
{
try
{
client
=
UnifiedUrlFilterClientNew
.
getClient
(
Config
.
rsidUrl
,
Config
.
rsidGroup
,
GroupType
.
PROVIDER
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"链接清洗中间件时出现错误,错误为:::{}"
,
e
);
}
}
}
}
}
/**
* @Description 验证微博是否重复
* @param mid
* @return
*/
public
static
boolean
isWeiboExit
(
String
mid
){
//循环3次避免连接超时引起的验证失效
for
(
int
i
=
0
;
i
<
3
;
i
++){
try
{
return
client
.
uniqueContains
(
mid
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"判断此条微博消息是否存在出现问题"
,
e
.
fillInStackTrace
());
ZhiWeiTools
.
sleep
(
200
);
continue
;
}
}
return
false
;
}
}
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