Giter VIP home page Giter VIP logo

check_submission_status's Introduction

使用说明

本程序会自动登录Scholar One投稿系统,获取当前稿件的状态,并将状态(若状态发生变化)发送到指定邮箱
可以配合crontab或者timer定时运行,实现自动化检测稿件状态的功能

1. 安装谷歌浏览器

Windows直接下载安装exe文件即可
Linux系统下,直接下载deb文件安装即可

2. 安装谷歌浏览器驱动

点击这里下载
根据提示下载对应版本的驱动(注意谷歌浏览器版本号、操作系统类型必须匹配)压缩包,解压出可执行文件chromedriver(.exe)

3. 检测是否安装成功

chromedriver --version

# ChromeDriver 115.0.5790.170 (cc0d30c2ca5577520c8646671513241faa0bc105-refs/branch-heads/5790@{#1923})

4. 安装依赖

pip install bs4 splinter selenium lxml

5. 修改配置

重命名config.py文件为config.example.py文件,修改其中的配置项

6. 运行

python3 main.py

7. 使用crontab定时运行

crontab -e
# 添加如下内容:表示每天本地时间8点运行一次
0 8 * * * bash -c "cd /abs_path/to/this/project && python3 main.py"

使用service timer定时运行

创建/etc/systemd/system/check_submission_status.service文件,添加如下内容

[Unit]
Description=Check Submission Status service
After=network.target
Wants=check_submission_status.timer

[Service]
Type=oneshot
User=your_username
WorkingDirectory=/abs_path/to/this/project
ExecStart=/usr/bin/python3 main.py
Restart=on-failure

[Install]
WantedBy=multi-user.target

创建/etc/systemd/system/check_submission_status.timer文件,添加如下内容

[Unit]
Description=Check Submission Status timer
Requires=check_submission_status.service

[Timer]
Unit=check_submission_status.service
# AccuracySec = 1us
RandomizedDelaySec = 1h
# 每天UTC时间1点和12点运行一次
OnCalendar=*-*-* 01,12:00:00 UTC
Persistent=yes

[Install]
WantedBy=timers.target

启动定时器

systemctl daemon-reload
systemctl enable check_submission_status.timer
systemctl start check_submission_status.timer

# 查看系统所有的定时器状态
systemctl list-timers --no-pager

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.