Skip to content

Instantly share code, notes, and snippets.

@fferegrino
Last active May 4, 2022 05:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fferegrino/b1a0eb3ac034bce7175ba0d115811d4f to your computer and use it in GitHub Desktop.
Save fferegrino/b1a0eb3ac034bce7175ba0d115811d4f to your computer and use it in GitHub Desktop.
Snippets for "Downloading data from Reddit using Python"
name: Download dataset
on:
schedule:
- cron: "0 10 * * *"
jobs:
process:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pipenv
pipenv install --system --dev
- name: Download dataset from Reddit
env:
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }}
PASSWORD: ${{ secrets.PASSWORD }}
run: python download_threads.py
- name: Commit changes
run: |
git config --global user.email "antonio.feregrino@gmail.com"
git config --global user.name "Antonio Feregrino"
git add data/
git diff --quiet && git diff --staged --quiet || git commit -m "Updated: `date +'%Y-%m-%d %H:%M'`"
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment