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:
2025-12-03 17:19:56 +08:00
commit f524713cb6
35 changed files with 6719 additions and 0 deletions

28
.github/workflows/weekly.yml vendored Normal file
View 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