Initial commit: HBR 文章爬蟲專案
- Scrapy 爬蟲框架,爬取 HBR 繁體中文文章 - Flask Web 應用程式,提供文章查詢介面 - SQL Server 資料庫整合 - 自動化排程與郵件通知功能 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
28
.github/workflows/weekly.yml
vendored
Normal file
28
.github/workflows/weekly.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
name: weekly-crawl
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0 * * 1" # 週一 00:00 UTC ≈ 台北 08:00
|
||||
workflow_dispatch: {}
|
||||
jobs:
|
||||
crawl-and-mail:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.11"
|
||||
- run: pip install scrapy
|
||||
- name: Run crawler
|
||||
run: scrapy crawl hbr
|
||||
- name: Send mail with CSV
|
||||
env:
|
||||
GMAIL_USERNAME: ${{ secrets.GMAIL_USERNAME }}
|
||||
GMAIL_APP_PASSWORD: ${{ secrets.GMAIL_APP_PASSWORD }}
|
||||
MAIL_TO: ${{ secrets.MAIL_TO }}
|
||||
run: |
|
||||
python send_mail.py hbr_articles.csv
|
||||
- name: Upload CSV as artifact (optional)
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: hbr_articles_csv
|
||||
path: hbr_articles.csv
|
||||
Reference in New Issue
Block a user