1 Star 0 Fork 0

ndj888/SmartJackReptile

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.py 1.06 KB
一键复制 编辑 原始数据 按行查看 历史
ndj888 提交于 2017-10-29 21:09 +08:00 . 提交定时任务代码
# coding: utf-8
# by jjc
from src.reptile.data.XhjDataThead import XhjDataThead
from src.reptile.data.XlNewsDataThead import XlNewsDataThead
from src.reptile.lib.Contab import Crontab
from src.reptile.lib.WorkProcess import WorkProcess
from src.reptile.service.XhjSpider import XhjSpider
from src.reptile.service.XlNewsSpider import XlNewsSpider
from src.reptile.task.SendJokes import SendJokes
from src.reptile.task.SendNews import SendNews
if __name__ == '__main__':
MAX_THEAD_LEN = 1
process = WorkProcess()
xhjSpider = XhjSpider()
# 新浪新闻
xlnews_spider = XlNewsSpider()
# join thead
process.append_thead(xhjSpider)
process.append_thead(xlnews_spider)
# 数据写入线程
process.append_thead(XhjDataThead(xhjSpider))
process.append_thead(XlNewsDataThead(xlnews_spider))
# 加入任务调度线程
crontab_obj = Crontab()
crontab_obj.task_list.append(SendNews())
crontab_obj.task_list.append(SendJokes())
process.append_thead(crontab_obj)
print('开始采集........................')
process.run()
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/ndj888/SmartJackReptile.git
[email protected]:ndj888/SmartJackReptile.git
ndj888
SmartJackReptile
SmartJackReptile
master

搜索帮助