Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: give up using schedule #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,14 @@ When text mode is enabled (default by `config.ini.example`), text diff of news i
To disable text mode, set `textmode` in `[global]` of `config.ini` to `false`.

## run
Use screen or something to keep session.

```
source keiojp-scraper/venv/activate.fish
python3 ./scrape.py
```

## run regularly
Use crontab.
Designate python3 under venv.
```
10 9,17 * * * /path/to/python3 /path/to/repo/scrape.py
```
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ chromedriver-binary==83.0.4103.39.0
configparser==5.0.0
idna==2.9
requests==2.23.0
schedule==0.6.0
selenium==3.141.0
urllib3==1.25.9
6 changes: 1 addition & 5 deletions scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import chromedriver_binary
import os
import requests
import schedule
import copy
import re
import json
Expand Down Expand Up @@ -191,7 +190,4 @@ def main():
os.remove(pngFile)


schedule.every().hour.at(':10').do(main)
while True:
schedule.run_pending()
time.sleep(1)
main()