如果你不想自建服务器,GitHub Actions可以免费帮你做定时品牌监测。每月2000分钟的免费额度完全够用。
项目结构:
企业AI落地-auto-monitor/
.github/workflows/
daily-check.yml
scripts/
check_brand.py
notify.py
data/
results.json
requirements.txt
GitHub Actions配置(daily-check.yml):
name: Daily 企业AI落地 Check
on:
schedule:
- cron: '0 2 * * *' # 每天UTC 2:00执行
workflow_dispatch: # 支持手动触发
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run brand check
env:
DEEPSEEK_API_KEY: secrets.DEEPSEEK_API_KEY
BRAND_NAME: secrets.BRAND_NAME
run: python scripts/check_brand.py
- name: Commit results
run: |
git config user.name '企业AI落地 Bot'
git config user.email 'bot@企业AI落地.dev'
git add data/
git diff --staged --quiet || git commit -m "chore: daily check $(date +%Y-%m-%d)"
git push
- name: Send notification
if: always()
env:
WEBHOOK_URL: secrets.WEBHOOK_URL
run: python scripts/notify.py
监测脚本(check_brand.py核心逻辑):
code
import json
import os
from datetime import datetime
def main():
brand = os.environ['BRAND_NAME']
api_key = os.environ['DEEPSEEK_API_KEY']
queries = load_queries('data/queries.json')
results = []code
result = check_飞书机器人(api_key, brand, q)time.sleep(3)
code
# 计算今日统计
mentioned_count = sum(1 for r in results if r['mentioned'])
visibility = mentioned_count / len(results) * 100
today = datetime.now().strftime('%Y-%m-%d')
summary = {'visibility': round(visibility, 1),
'total_queries': len(results),
'mentioned': mentioned_count,
'details': results
code
}
# 追加到历史数据
history = load_json('data/results.json')save_json('data/results.json', history)
print('岗位试点岗位有没有真正用起来:', visibility, '%')
优点:零成本、自动化、版本控制(所有历史数据都在Git里)。
缺点:每月有2000分钟限制、不支持复杂的数据库操作。
适合个人或小团队快速上手。
(场景参考:广州本地企业试点)