Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
source_forward
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
zhiwei
source_forward
Commits
ec4e9192
Commit
ec4e9192
authored
Aug 22, 2019
by
yangchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加牛科技 创业邦 it时代网 等自媒体采集 和修改蓝鲸的自媒体采集
parent
0e4b6f49
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
2 deletions
+40
-2
src/main/java/com/zhiwei/source_forward/run/MediaSelfSource.java
+1
-1
src/main/java/com/zhiwei/source_forward/util/MatchSource.java
+39
-1
No files found.
src/main/java/com/zhiwei/source_forward/run/MediaSelfSource.java
View file @
ec4e9192
...
@@ -25,7 +25,7 @@ public class MediaSelfSource {
...
@@ -25,7 +25,7 @@ public class MediaSelfSource {
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
ProxyFactory
.
init
(
"zookeeper://192.168.0.36:2181"
,
"local"
,
GroupType
.
PROVIDER
);
ProxyFactory
.
init
(
"zookeeper://192.168.0.36:2181"
,
"local"
,
GroupType
.
PROVIDER
);
List
<
String
>
urlList
=
new
ArrayList
<>();
List
<
String
>
urlList
=
new
ArrayList
<>();
urlList
.
add
(
"https://
v.youku.com/v_show/id_XNDA5Nzg4MzA4NA==.html
"
);
urlList
.
add
(
"https://
www.lanjinger.com/news/detail?id=115982
"
);
List
<
MediaSelfSourceBean
>
u
=
MediaSelfSource
.
getMediaSelfSource
(
urlList
);
List
<
MediaSelfSourceBean
>
u
=
MediaSelfSource
.
getMediaSelfSource
(
urlList
);
for
(
MediaSelfSourceBean
b
:
u
)
{
for
(
MediaSelfSourceBean
b
:
u
)
{
System
.
out
.
println
(
b
.
toString
());
System
.
out
.
println
(
b
.
toString
());
...
...
src/main/java/com/zhiwei/source_forward/util/MatchSource.java
View file @
ec4e9192
...
@@ -453,6 +453,30 @@ public class MatchSource {
...
@@ -453,6 +453,30 @@ public class MatchSource {
if
(
source
!=
null
&&
source
.
length
()>
1
){
if
(
source
!=
null
&&
source
.
length
()>
1
){
source
=
"易车网-"
+
source
;
source
=
"易车网-"
+
source
;
}
}
}
else
if
(
url
.
contains
(
"ittime.com.cn"
)){
//it时代网
source
=
document
.
select
(
"div.top.author > dl > dd > p > a"
).
text
();
if
(
Objects
.
nonNull
(
source
)
&&
!
source
.
isEmpty
()){
source
=
"it时代网-"
+
source
;
}
}
else
if
(
url
.
contains
(
"guancha.cn"
)){
// 风闻社区
source
=
document
.
select
(
"div.main-tow > div.box-left > div.article-content > div:nth-child(3) > div.user-main > h4 > a"
).
text
();
if
(
Objects
.
nonNull
(
source
)
&&
!
source
.
isEmpty
()){
source
=
"风闻社区-"
+
source
;
}
}
else
if
(
url
.
contains
(
"yesky.com"
)){
// 天极自媒体
source
=
document
.
select
(
"div.elf > dl > dd.bt > a"
).
text
();
if
(
Objects
.
nonNull
(
source
)
&&
!
source
.
isEmpty
()){
source
=
"天极自媒体-"
+
source
;
}
}
else
if
(
url
.
contains
(
"nkj.cn"
)){
// 牛科技
source
=
document
.
select
(
"div.widget.suxingme_post_author > div > div.author_name > a"
).
text
();
if
(
Objects
.
nonNull
(
source
)
&&
!
source
.
isEmpty
()){
source
=
"牛科技-"
+
source
;
}
}
else
if
(
url
.
contains
(
"chejiahao.autohome.com.cn"
)){
}
else
if
(
url
.
contains
(
"chejiahao.autohome.com.cn"
)){
//汽车之家
//汽车之家
source
=
document
.
select
(
"div.authorMes"
).
select
(
"[class=\"name text-overflow\"]"
)
source
=
document
.
select
(
"div.authorMes"
).
select
(
"[class=\"name text-overflow\"]"
)
...
@@ -540,6 +564,18 @@ public class MatchSource {
...
@@ -540,6 +564,18 @@ public class MatchSource {
if
(
source
!=
null
&&
!
source
.
equals
(
""
)){
if
(
source
!=
null
&&
!
source
.
equals
(
""
)){
source
=
"科技讯-"
+
source
;
source
=
"科技讯-"
+
source
;
}
}
}
else
if
(
url
.
contains
(
"tmtpost.com"
)){
source
=
document
.
select
(
"article > div.post-info > a"
)
.
text
();
if
(
source
!=
null
&&
!
source
.
equals
(
""
)){
source
=
"钛媒体-"
+
source
;
}
}
else
if
(
url
.
contains
(
"cyzone.cn"
)){
source
=
document
.
select
(
"div.article-author-info > div.author-main > div > div.a-word > div.a-name > a"
)
.
text
();
if
(
source
!=
null
&&
!
source
.
equals
(
""
)){
source
=
"创业邦-"
+
source
;
}
}
else
if
(
url
.
contains
(
"36kr.com"
)){
}
else
if
(
url
.
contains
(
"36kr.com"
)){
source
=
document
.
select
(
"div.info-header-text > a.author-name"
).
text
();
source
=
document
.
select
(
"div.info-header-text > a.author-name"
).
text
();
if
(
source
!=
null
&&
!
source
.
equals
(
""
)){
if
(
source
!=
null
&&
!
source
.
equals
(
""
)){
...
@@ -599,10 +635,12 @@ public class MatchSource {
...
@@ -599,10 +635,12 @@ public class MatchSource {
source
=
"蓝鲸-"
+
source
;
source
=
"蓝鲸-"
+
source
;
}
}
}
else
if
(
url
.
contains
(
"lanjinger.com"
))
{
}
else
if
(
url
.
contains
(
"lanjinger.com"
))
{
source
=
document
.
select
(
"div.article_info > span.info.author_name"
).
text
().
replaceAll
(
".*编辑| "
,
""
);
if
(
document
.
select
(
"div.content_left > div:nth-child(2) > span"
).
text
().
contains
(
"专栏"
))
{
source
=
document
.
select
(
"a.author_name"
).
text
().
replaceAll
(
".*编辑| "
,
""
);
if
(
source
!=
null
&&
!
source
.
equals
(
""
))
{
if
(
source
!=
null
&&
!
source
.
equals
(
""
))
{
source
=
"蓝鲸财经-"
+
source
;
source
=
"蓝鲸财经-"
+
source
;
}
}
}
}
else
if
(
url
.
contains
(
"huxiu.com"
))
{
}
else
if
(
url
.
contains
(
"huxiu.com"
))
{
source
=
document
.
select
(
"div.article__author-info-box > a.article-author-info > span.author-info__username"
).
text
();
source
=
document
.
select
(
"div.article__author-info-box > a.article-author-info > span.author-info__username"
).
text
();
if
(
source
!=
null
&&
!
source
.
equals
(
""
))
{
if
(
source
!=
null
&&
!
source
.
equals
(
""
))
{
...
...
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