Reddit Stash Scraper #29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Reddit Stash Scraper | |
on: | |
schedule: | |
- cron: "0 23 * * *" # Adjust according to your desired schedule (e.g., 23:00 UTC for midnight CET) | |
workflow_dispatch: # Allows manual trigger of the workflow | |
jobs: | |
run-script: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: Download existing Reddit data from Dropbox | |
env: | |
DROPBOX_REFRESH_TOKEN: ${{ secrets.DROPBOX_REFRESH_TOKEN }} | |
DROPBOX_APP_KEY: ${{ secrets.DROPBOX_APP_KEY }} | |
DROPBOX_APP_SECRET: ${{ secrets.DROPBOX_APP_SECRET }} | |
run: | | |
python dropbox_utils.py --download # dowload the files | |
- name: Run Reddit Stash Script | |
env: | |
REDDIT_CLIENT_ID: ${{ secrets.REDDIT_CLIENT_ID }} | |
REDDIT_CLIENT_SECRET: ${{ secrets.REDDIT_CLIENT_SECRET }} | |
REDDIT_USERNAME: ${{ secrets.REDDIT_USERNAME }} | |
REDDIT_PASSWORD: ${{ secrets.REDDIT_PASSWORD }} | |
run: | | |
python reddit_stash.py # process the files | |
- name: Upload updated Reddit data to Dropbox | |
env: | |
DROPBOX_REFRESH_TOKEN: ${{ secrets.DROPBOX_REFRESH_TOKEN }} | |
DROPBOX_APP_KEY: ${{ secrets.DROPBOX_APP_KEY }} | |
DROPBOX_APP_SECRET: ${{ secrets.DROPBOX_APP_SECRET }} | |
run: | | |
python dropbox_utils.py --upload # upload the files |