Watch
Watch
Poll a page and get only the links you haven't seen before.
watch reads a listing, feed or search page and returns the same-site links
that are new since your last poll. You decide when to poll and what a link
means.
- Filter links with a regular expression.
- The first poll returns every current link and sets
first_poll, so you can treat it as a baseline. - Each poll is one ordinary read: paced, receipted, and able to climb past walls.
Many sites: watch_sites
Section titled “Many sites: watch_sites”To keep up with many sites at once, watch_sites uses what each site
publishes about its own new pages instead of reading its front page:
- the feeds it advertises (
<link rel="alternate">: RSS, Atom, JSON Feed); - the sitemaps
robots.txtnames (news sitemaps first, then the most recently changed); - a few conventional feed paths (
/feed,/rss.xml, …) when it advertises none.
They are found once per site and remembered for a week. Every poll fetches
them with conditional requests (If-None-Match, If-Modified-Since), so an
unchanged feed costs one small 304. Pages already reported are remembered,
and the same story under two URLs (syndication) is reported once.
new = await web.watch_sites(["https://news.example.com/", "https://blog.example.org/"], since="2026-10-07", read_new=True)for page in new["pages"]: print(page["published"], page["url"], page["quality"])frankensurf watch-sites https://news.example.com/ https://blog.example.org/ --since 2026-10-07read_new reads the new pages too, with main content, as one paced batch.
requests and unchanged_feeds in the answer say what a poll cost.
One page: watch
Section titled “One page: watch”poll = await web.watch("https://news.ycombinator.com/", link_pattern=r"item\?id=\d+")for link in poll["new"]: print(link["url"])frankensurf watch https://news.ycombinator.com/ --link-pattern 'item\?id=\d+'{ "url": "https://news.ycombinator.com/", "status": "observed", "first_poll": true, "new": [ { "url": "https://news.ycombinator.com/item?id=49969183", "text": "4 hours ago" }, { "url": "https://news.ycombinator.com/item?id=49971230", "text": "1 hour ago" } ], "links_on_page": 30, "seen_count": 30, "receipt": { "status": "observed", "method": "http" }}Options
Section titled “Options”| Option | Default | Description |
|---|---|---|
link_pattern |
all same-site links | Regular expression a link URL must match. |
state_key |
the URL | Name of the watch, if you watch one URL several ways. |
max_seen |
5000 |
Links remembered per watch. |
Seen links are stored under <state>/watches/.