尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证制作者的介绍仅有上面的一句话。 更多详情请阅读仓库 README。 仓库 README ↗
正在加载完整 README。
查看完整 README ↗A simpler way to browse Canadian drug shortage and discontinuation reports from Health Product Shortages Canada. The data is refreshed twice a day.
Live site: https://zeptotech.github.io/drugshortages/
This is an independent tool for healthcare professionals. It is not affiliated with Health Canada. Always confirm details with the official report, which is linked from each entry. Use at your own discretion.
late_submission flag)./ to jump to search, and a phone
layout.There is no server. A scheduled GitHub Actions job is the backend, and the site is static files served by GitHub Pages.
Midnight + noon Eastern (GitHub Actions) Anytime (browser)
┌───────────────────────────────────────┐ ┌───────────────────────────┐
│ scripts/fetch_and_diff.py │ │ index.html + app.js │
│ 1. log in to the API (repo secrets) │ │ loads data/*.json │
│ 2. pull current + recent reports │ │ search, filters, sorting │
│ 3. compare with the previous data │ │ all run in the browser │
│ 4. write data/*.json │ │ (no API calls) │
│ commit data/ → deploy GitHub Pages ───┼──►│ │
└───────────────────────────────────────┘ └───────────────────────────┘
The API password lives only in GitHub Actions secrets. The browser never talks to the API.
| Statuses | How | Requests |
|---|---|---|
active_confirmed, anticipated_shortage, to_be_discontinued | Full pull, sorted by id ascending, 100 per page (as the API requires for multi-report extraction) | ~25 |
resolved, avoided_shortage, discontinued, reversed | Updated in the last 30 days only, newest first | ~5 |
| Reports that left the current lists since the last run | One detail lookup each, to see what they became | a few |
The API allows 1,000 requests per hour, and a run uses about 30–45.
The job keeps only the English fields the site needs, compares them with the
previous snapshot, and records what changed. It aborts without touching the data
if the login fails, the API errors, or a status count suddenly drops by more than
5% from the previous run's (use --force to override a real drop). When that check
stops a run, the log lists the current status of a sample of the missing reports,
which shows whether the drop is real or the API left them out.
| File | Contents |
|---|---|
data/shortages.json | Current shortages plus those resolved or avoided in the last 30 days |
data/discontinuations.json | Upcoming discontinuations plus those discontinued or reversed in the last 30 days |
data/meta.json | Last check time and counts per status |
data/changes/YYYY-MM-DD.json | New, updated and status-changed reports for that day (last 30 days; older files are deleted) |
data/changes/index.json | Days with changes in the last 30 days, newest first |
Each report is written on its own line, so the daily data commits show exactly which reports changed.
These follow the official site's summary report:
HPS_EMAIL and HPS_PASSWORD.The workflow (.github/workflows/update-data.yml):
data/ if it
changed, and deploys.main: only redeploys the site.The job runs twice a day, 12 hours apart (GitHub cron always uses UTC):
0 5 * * *: 05:00 UTC, which is midnight EST in winter and 1 AM EDT in summer.0 17 * * *: 17:00 UTC, which is noon EST in winter and 1 PM EDT in summer.A second run on the same day adds to that day's change log rather than replacing it, so "What's new" still shows one list per day. GitHub can start scheduled runs late when it is busy, sometimes by hours, so the actual time varies.
Fetch data, using only the Python 3.9+ standard library (nothing to install):
read "HPS_EMAIL?Email: "; read -s "HPS_PASSWORD?Password: "; echo
HPS_EMAIL=$HPS_EMAIL HPS_PASSWORD=$HPS_PASSWORD python3 scripts/fetch_and_diff.py
Preview the site:
python3 -m http.server 8000
# open http://localhost:8000
The bot commits data daily, so run git pull before starting work.
The code is commented for readers new to it. app.js starts with an overview of
how the page works.
index.html, app.js, styles.css the website (no build step)
scripts/fetch_and_diff.py daily fetch, compare and write
.github/workflows/update-data.yml schedule, commit and deploy
data/ generated, committed by the bot
Data comes from the Health Product Shortages Canada public API. Only English fields are used.