Literature Alerts is a Python runner that retrieves papers from arXiv using YAML topic queries and publishes them to Discord through webhooks. GitHub Actions runs the fetch on a schedule or on demand, while date filters and message modes shape the stream. The result is a configurable reading radar for research areas you want to follow.
Fork the repository and create or edit a YAML file under topics/. Each entry identifies a research topic with an id, a display title, an arxiv_url query and a webhook_env destination variable. These are research streams defined by queries, rather than arXiv discussion threads. The runner consumes the query URL as supplied.
topics:
- id: hep-ex
title: "High Energy Physics - Experiment"
webhook_env: "DISCORD_WEBHOOK_URL_HEP_EX"
arxiv_url: "https://export.arxiv.org/api/query?search_query=cat:hep-ex&sortBy=submittedDate&sortOrder=descending&max_results=100"
- id: hep-ph
title: "High Energy Physics - Phenomenology"
webhook_env: "DISCORD_WEBHOOK_URL_HEP_PH"
arxiv_url: "https://export.arxiv.org/api/query?search_query=cat:hep-ph&sortBy=submittedDate&sortOrder=descending&max_results=100"
In your Discord channel, open Settings → Integrations → New Webhook and copy its URL. In your GitHub repository, open Settings → Secrets and variables → Actions and create a repository secret for that URL. Expose the secret as the environment variable named by webhook_env in the workflow step.
- name: Run HEP topics via runner
env:
TIME_FRAME: ${{ github.event.inputs.time_frame || '1' }}
ONLY_TOPIC: ${{ github.event.inputs.only_topic || 'all' }}
DISCORD_WEBHOOK_URL_BARYOGENESIS: ${{ secrets.DISCORD_HEP_EARLY_UNIVERSE_BARYOGENESIS_WEBHOOK }}
DISCORD_WEBHOOK_URL_QGP_ML: ${{ secrets.DISCORD_HEP_QGP_ML_WEBHOOK }}
DISCORD_WEBHOOK_URL_QGP_NN: ${{ secrets.DISCORD_HEP_QGP_NEURAL_WEBHOOK }}
DISCORD_WEBHOOK_URL_QGP_BAYESIAN: ${{ secrets.DISCORD_HEP_QGP_BAYESIAN_INFERENCE_WEBHOOK }}
DISCORD_WEBHOOK_URL_QGP_DKL: ${{ secrets.DISCORD_HEP_QGP_DEEP_KERNEL_LEARNING_WEBHOOK }}
DISCORD_WEBHOOK_URL_NUCL_EX: ${{ secrets.DISCORD_HEP_NUCLEAR_EXPERIMENT_WEBHOOK }}
DISCORD_WEBHOOK_URL_NUCL_TH: ${{ secrets.DISCORD_HEP_NUCLEAR_THEORY_WEBHOOK }}
DISCORD_WEBHOOK_URL_HEP_LAT: ${{ secrets.DISCORD_HEP_LATTICE_WEBHOOK }}
DISCORD_WEBHOOK_URL_HEP_TH: ${{ secrets.DISCORD_HEP_THEORY_WEBHOOK }}
DISCORD_WEBHOOK_URL_HEP_PH: ${{ secrets.DISCORD_HEP_PHENOMENOLOGY_WEBHOOK }}
DISCORD_WEBHOOK_URL_HEP_EX: ${{ secrets.DISCORD_HEP_EXPERIMENT_WEBHOOK }}
run: python runner.py topics/hep.yml
Edit .github/workflows/check-new-papers.yml. Its existing schedule is 0 8 * * *: daily at 08:00 UTC, or 05:00 in São Paulo (UTC−3). For a daily run at 09:00 São Paulo time, change the cron expression to 0 12 * * *. The excerpt below preserves the project’s current schedule. Commit the workflow to the default branch. You can also run it manually from Actions with the topic and time-frame inputs.
on:
schedule:
- cron: "0 8 * * *" # daily at 08:00 UTC = 05:00 BRT (UTC-3)
workflow_dispatch:
inputs:
only_topic:
description: "Run only this topic id (default: all)"
required: false
default: "all"
type: string
time_frame:
description: "Days back (default: 1) or 'all'"
required: false
default: "1"
type: string
| Environment variable | Default | What it controls |
|---|---|---|
| TIME_FRAME | 1 | Days of papers to include; use all to disable date filtering. |
| ONLY_TOPIC | all | Run only the matching topic id, or every topic. |
| MODE | auto | auto, per_paper or summary delivery. |
| REQUEST_TIMEOUT | 20 | HTTP timeout in seconds. |
| MAX_RETRIES_429 | 8 | Extra attempts after Discord HTTP 429 rate limits. |
| POST_DELAY_SECONDS | 0.4 | Delay between individual paper posts. |
| MAX_POSTS_PER_TOPIC | 0 | Post cap after date filtering; 0 means no cap. |
| DISCORD_CHUNK_LIMIT | 1800 | Maximum summary chunk size. |
| SUMMARY_THRESHOLD | 50 | Force summary delivery above this paper count. |
TIME_FRAME_RAW = os.getenv("TIME_FRAME", "1").strip().lower() # "1", "7", "30", "360", "all"
ONLY_TOPIC = os.getenv("ONLY_TOPIC", "all").strip() # "all" or a topic id # >>> CHANGED
MODE = os.getenv("MODE", "auto").strip().lower() # "auto" | "per_paper" | "summary"
REQUEST_TIMEOUT = int(os.getenv("REQUEST_TIMEOUT", "20"))
POST_DELAY_SECONDS = float(os.getenv("POST_DELAY_SECONDS", "0.4"))
MAX_RETRIES_429 = int(os.getenv("MAX_RETRIES_429", "8"))
DISCORD_CHUNK_LIMIT = int(os.getenv("DISCORD_CHUNK_LIMIT", "1800"))
MAX_POSTS_PER_TOPIC = int(os.getenv("MAX_POSTS_PER_TOPIC", "0")) # 0 = no cap after time filter
# Safety: if too many papers, force summary (prevents floods / 429) # >>> CHANGED
SUMMARY_THRESHOLD = int(os.getenv("SUMMARY_THRESHOLD", "50"))
When adding a topic file, add a workflow step that binds its required webhook variables and passes the file to runner.py. Run the workflow manually, then open Actions → arXiv → Discord → run details. Check fetched and filtered article counts, posted messages and errors. Confirm delivery in Discord before expanding the queries.
# --- SUMMARY ---
print("---")
print(f"Total results on arXiv : {total_available}")
print(f"Total fetched from arXiv : {total_fetched}")
print(f"Passed time filter : {len(papers)}")
print(f"Successfully posted : {posted_ok}")
print(f"Failed to post : {posted_fail}")
This page was last updated at 2026-11-03 16:10.