Last active
May 4, 2022 05:14
-
-
Save fferegrino/b1a0eb3ac034bce7175ba0d115811d4f to your computer and use it in GitHub Desktop.
Snippets for "Downloading data from Reddit using Python"
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: 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