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
f97d4454
Commit
f97d4454
authored
Aug 23, 2019
by
win 10
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决冲突
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 @
f97d4454
...
...
@@ -25,7 +25,7 @@ public class MediaSelfSource {
public
static
void
main
(
String
[]
args
)
{
ProxyFactory
.
init
(
"zookeeper://192.168.0.36:2181"
,
"local"
,
GroupType
.
PROVIDER
);
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
);
for
(
MediaSelfSourceBean
b
:
u
)
{
System
.
out
.
println
(
b
.
toString
());
...
...
src/main/java/com/zhiwei/source_forward/util/MatchSource.java
View file @
f97d4454
...
...
@@ -453,6 +453,30 @@ public class MatchSource {
if
(
source
!=
null
&&
source
.
length
()>
1
){
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"
)){
//汽车之家
source
=
document
.
select
(
"div.authorMes"
).
select
(
"[class=\"name text-overflow\"]"
)
...
...
@@ -540,6 +564,18 @@ public class MatchSource {
if
(
source
!=
null
&&
!
source
.
equals
(
""
)){
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"
)){
source
=
document
.
select
(
"div.info-header-text > a.author-name"
).
text
();
if
(
source
!=
null
&&
!
source
.
equals
(
""
)){
...
...
@@ -599,10 +635,12 @@ public class MatchSource {
source
=
"蓝鲸-"
+
source
;
}
}
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
(
""
))
{
source
=
"蓝鲸财经-"
+
source
;
}
}
}
else
if
(
url
.
contains
(
"huxiu.com"
))
{
source
=
document
.
select
(
"div.article__author-info-box > a.article-author-info > span.author-info__username"
).
text
();
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