init: initial commit

This commit is contained in:
huangboming
2025-04-25 18:15:59 +08:00
commit 5e35a33c3c
9 changed files with 503 additions and 0 deletions

38
.github/workflows/update_feed.yml vendored Normal file
View File

@@ -0,0 +1,38 @@
name: Update Hugging Face Papers RSS Feed
on:
schedule:
# Runs daily at midnight UTC
- cron: '0 0 * * *'
workflow_dispatch: # Allows manual triggering
jobs:
update-feed:
runs-on: ubuntu-latest
permissions:
contents: write # Allow the job to push changes
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11' # Specify Python version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run parser and generate feed
run: python parser.py --source https://huggingface.co/papers --output feed.xml
- name: Commit and push if feed changed
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add feed.xml
# Commit only if there are changes staged
git diff --staged --quiet || git commit -m "Update RSS feed"
git push

View File

@@ -0,0 +1,46 @@
name: Update Hugging Face Papers Monthly RSS Feed
on:
schedule:
# Runs on the 1st of every month at midnight UTC
- cron: '0 0 1 * *'
workflow_dispatch: # Allows manual triggering
jobs:
update-feed-monthly:
runs-on: ubuntu-latest
permissions:
contents: write # Allow the job to push changes
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11' # Specify Python version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Generate monthly URL
id: generate_url
run: |
MONTHLY_TAG=$(date +%Y-%m) # Format: YYYY-MM
echo "Generated monthly tag: $MONTHLY_TAG"
URL="https://huggingface.co/papers/month/${MONTHLY_TAG}"
echo "URL=$URL" >> $GITHUB_OUTPUT
- name: Run parser and generate monthly feed
run: python parser.py --source ${{ steps.generate_url.outputs.URL }} --output feed_monthly.xml
- name: Commit and push if monthly feed changed
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add feed_monthly.xml
# Commit only if there are changes staged
git diff --staged --quiet || git commit -m "Update Monthly RSS feed"
git push

View File

@@ -0,0 +1,46 @@
name: Update Hugging Face Papers Weekly RSS Feed
on:
schedule:
# Runs every Monday at midnight UTC
- cron: '0 0 * * 1'
workflow_dispatch: # Allows manual triggering
jobs:
update-feed-weekly:
runs-on: ubuntu-latest
permissions:
contents: write # Allow the job to push changes
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11' # Specify Python version
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Generate weekly URL
id: generate_url # Give this step an ID to reference its output
run: |
WEEKLY_TAG=$(date +%Y-W%V) # Format: YYYY-Www (ISO 8601 week)
echo "Generated weekly tag: $WEEKLY_TAG"
URL="https://huggingface.co/papers/week/${WEEKLY_TAG}"
echo "URL=$URL" >> $GITHUB_OUTPUT # Set output for use in next step
- name: Run parser and generate weekly feed
run: python parser.py --source ${{ steps.generate_url.outputs.URL }} --output feed_weekly.xml
- name: Commit and push if weekly feed changed
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add feed_weekly.xml
# Commit only if there are changes staged
git diff --staged --quiet || git commit -m "Update Weekly RSS feed"
git push