Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
weiboDomain
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
xuyimeng
weiboDomain
Commits
c678dd80
Commit
c678dd80
authored
Mar 14, 2018
by
chenweitao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
测试新的md工具
parent
157f295d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
21 deletions
+37
-21
README.md
+37
-21
No files found.
README.md
View file @
c678dd80
# 微博领域标签大v采集
# 微博领域标签大v采集
程序md
---
---
服务器配置
运行服务器:192.168.0.36
目录:/usr/data/javacrawler/weiboDomain
数据表说明
数据库地址 115.236.59.91
数据库名 weiboDomain
| 数据表名 | 备注 |
| -------- | :----: |
| domainTag |领域分类,以及各领域的采集依据 |
| weiboDomain | 采集的各领域用户表 |
采集地址:https://d.weibo.com/1087030002_417#
采集地址:https://d.weibo.com/1087030002_417#
> 使用quartz定时器,所以主方法中仅初始化spring容器
> 使用quartz定时器,所以主方法中仅初始化spring容器
package com.zhiweidata.weiboDomain.start;
```
python
public
static
void
main
(
String
[]
args
)
{
ApplicationContext
ctx
=
new
ClassPathXmlApplicationContext
(
"applicationContext.xml"
);
> package com.zhiweidata.weiboDomain.start;
System
.
out
.
println
(
"微博热门榜单采集开始..."
);
> public static void main(String[] args) {
//
程序主体切换至
com
.
zhiweidata
.
weiboDomain
.
quartz
定时器
> ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
>
> System.out.println("微博热门榜单采集开始...");
> //程序主体切换至com.zhiweidata.weiboDomain.quartz定时器
>
> }
}
```
> 定时器程序入口在 com.zhiweidata.weiboDomain.quartz
> 定时器程序入口在 com.zhiweidata.weiboDomain.quartz
>
> @Scheduled(cron = "0 0 20 * * *")
```
python
> public void execute() {
@Scheduled
(
cron
=
"0 0 20 * * *"
)
> String time = LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyy-MM-dd
public
void
execute
()
{
> HH"));
String
time
=
LocalDateTime
.
now
()
.
format
(
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd
> long start = System.currentTimeMillis();
HH"
));
> String cookie = "";
long
start
=
System
.
currentTimeMillis
();
> serice.crawlerData(cookie);
String
cookie
=
""
;
> long end = System.currentTimeMillis();
serice
.
crawlerData
(
cookie
);
> log.info(time + "次运行耗时:" + (end - start) + "\t毫秒");
long
end
=
System
.
currentTimeMillis
();
> }
log
.
info
(
time
+
"次运行耗时:"
+
(
end
-
start
)
+
"
\t
毫秒"
);
\ No newline at end of file
}
```
\ No newline at end of file
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