Skip to content

Scrape Announcements #1806

Scrape Announcements

Scrape Announcements #1806

Workflow file for this run

name: Scrape Announcements
on:
schedule:
# Start of day in AU: 9 PM to 11:59 PM UTC on Sun-Thu (0-4).
- cron: "*/30 21-23 * * 0-4"
# End of day in AU: 12 AM to 9:59 AM UTC on Mon-Fri (1-5).
- cron: "*/30 0-9 * * 1-5"
workflow_dispatch:
jobs:
scrape:
runs-on: ubuntu-latest
steps:
- name: Restore history
uses: actions/cache@v5
id: cache-history
with:
path: /tmp/annscraper/asx_report_history.json
key: ${{ runner.os }}-history-${{ github.run_id }}
restore-keys: |
${{ runner.os }}-history
- name: Get latest
run: |-
curl --location --request GET \
'https://github.com/shanehull/annscraper/releases/latest/download/annscraper-linux-amd64' \
-o annscraper
- name: Make executable
run: chmod +x ./annscraper
- name: Update apt package list
run: sudo apt update
- name: Install popper-utils
run: sudo apt install -y poppler-utils
- name: Run scraper
env:
KEYWORDS: ${{ vars.KEYWORDS }}
TICKERS: ${{ vars.TICKERS }}
SMTP_SERVER: ${{ secrets.SMTP_SERVER }}
SMTP_PASSWORD: ${{ secrets.SMTP_PASSWORD }}
SMTP_USER: ${{ secrets.SMTP_USER }}
FROM_EMAIL: ${{ secrets.FROM_EMAIL }}
TO_EMAIL: ${{ secrets.TO_EMAIL }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
MODEL: ${{ vars.MODEL }}
run: |-
./annscraper \
--keywords "$KEYWORDS" \
--tickers "$TICKERS" \
--smtp-server "$SMTP_SERVER" \
--smtp-pass "$SMTP_PASSWORD" \
--smtp-user "$SMTP_USER" \
--from-email "$FROM_EMAIL" \
--to-email "$TO_EMAIL" \
--gemini-key "$GEMINI_API_KEY" \
--model "$MODEL" \
--price-sensitive=true \
--quiet=true