Back to APIs list
Hacker News API examples & templates
Use these vals as a playground to view and fork Hacker News API examples and templates on Val Town. Run any example below or find templates that can be used as a pre-built solution.
harpers
@visnup
HTTP (deprecated)
An interesting Harper's message of the day when I open a shell. Setup crontab to grab updates on the first of the month 10 0 1 * * curl -s https://visnup-harpers.web.val.run > $HOME/.motd ~/.config/fish/functions/fish_greeting.fish to pick a random line on new fish shell; other shell support left to the reader function fish_greeting
set line (random 1 (cat ~/.motd | wc -l))
awk "NR==$line" ~/.motd | fold -s -w (tput cols)
end
gitReleaseNotes
@kylem
HTTP (deprecated)
Github Release Notes from package.json Enter a raw github URL to a package.json, https://raw.githubusercontent.com/username/repo/branch/package.json and get a response of all release notes for all packages from current to latest. Roadmap [ ] GenAI summary [ ] Weekly cron email reports [ ] Send update PRs [ ] Other package managers like PyPi [ ] Formatting/styling [ ] Loading spinner
detectNewWebsiteContents
@vipshek
Cron
Detect New Website Contents This val fetches a given publicly-accessible URL and detects whether its contents have changed. If they have, it sends an email to notify about the change. Changes are detected by computing a quick hash of the website's contents, storing the hash, and comparing against the previously stored hash on each request. Trivial changes to the website's contents will count as a change, which may not be desired for some use cases. Usage Fork this val and update the URL to point to your website. Optionally, update the storage key or email subject. Set a schedule for how often you want to detect changes (default 1h). Receive updates when the given website changes.