Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
jbaranski committed Nov 29, 2024
0 parents commit 7c8a13c
Show file tree
Hide file tree
Showing 13 changed files with 5,232 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/megamillions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: fetch-latest-megamillions

on:
push:
branches:
- main
schedule:
- cron: "0 */12 * * *"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install Python dependencies
run: |-
cd $GITHUB_WORKSPACE/scraper
pip install -r requirements.txt
# https://github.com/MarketingPipeline/Python-Selenium-Action/blob/main/.github/workflows/Selenium-Action_Template.yaml
- name: Installed OS package list
run: apt list --installed
- name: Removing previous chrome instances on runner
run: sudo apt purge google-chrome-stable
- name: Installing OS packages
run: pip install chromedriver-autoinstaller selenium

- name: Fetch latest Mega Millions numbers
env:
GITHUB_WORKSPACE: ${{ github.workspace }}
run: |-
cd $GITHUB_WORKSPACE/scraper
python -m src.main megamillions
cat $GITHUB_WORKSPACE/numbers/megamillions.csv
- name: Commit megamillions.csv file if changed
run: |-
git diff
git config --global user.email "[email protected]"
git config --global user.name "JEFF-bot"
git add -A
git commit -m "Update megamillions.csv" || exit 0
git push
48 changes: 48 additions & 0 deletions .github/workflows/powerball.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: fetch-latest-powerball

on:
push:
branches:
- main
schedule:
- cron: "0 */12 * * *"

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: pip
- name: Install Python dependencies
run: |-
cd $GITHUB_WORKSPACE/scraper
pip install -r requirements.txt
# https://github.com/MarketingPipeline/Python-Selenium-Action/blob/main/.github/workflows/Selenium-Action_Template.yaml
- name: Installed OS package list
run: apt list --installed
- name: Removing previous chrome instances on runner
run: sudo apt purge google-chrome-stable
- name: Installing OS packages
run: pip install chromedriver-autoinstaller selenium

- name: Fetch latest Powerball numbers
env:
GITHUB_WORKSPACE: ${{ github.workspace }}
run: |-
cd $GITHUB_WORKSPACE/scraper
python -m src.main powerball
cat $GITHUB_WORKSPACE/numbers/powerball.csv
- name: Commit powerball.csv file if changed
run: |-
git diff
git config --global user.email "[email protected]"
git config --global user.name "JEFF-bot"
git add -A
git commit -m "Update powerball.csv" || exit 0
git push
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.DS_Store
.idea
*.pyc
*.bak
*.dat
7 changes: 7 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Copyright 2024 Jeff Baranski

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Loading

0 comments on commit 7c8a13c

Please sign in to comment.