Sources
Adding, renaming, tagging, pausing and removing the sources a user follows (SI-524). Besides feeds, a source can be a GitHub repository’s releases, a JSON API, a web page without a feed (SI-556) or the links you add by hand: source-types.md (SI-557). Code: follow.ts and sources.ts for the services, feeds/discover.ts for finding feeds. In the app: Sources (/sources). Polling and source health are in scheduler.md; bulk import in import-export.md.
Adding a source
Add a source has a form per kind: Feed or site (below), GitHub releases, Web page, JSON API and One link (source-types.md). When Feed or site finds no feed at an address, Follow the page itself takes it to Web page. A feed takes two steps: find the feeds at an address, then follow one.
-
Find feeds. The address can be a feed, a site, a blog post or a YouTube channel. A missing scheme gets
https://, andfeed:links becomehttps. Hotaru fetches it:- a feed gives that feed;
- an HTML page gives the feeds it announces in its
<head>(<link rel="alternate" type="application/rss+xml">and the Atom, JSON Feed and RDF types), comment feeds last, at most 8. Each is fetched to check that it is a feed and to show its title, how many items it lists and when it last posted; - a GitHub repository (any address inside it, but not its
.atomfeeds) gives its releases (source-types.md); - a YouTube page gives the channel’s feed, and the playlist’s when the URL names one. YouTube doesn’t link its feeds for clients outside a browser session, so the channel id comes from the URL, the canonical link or the page’s metadata;
- a page that links to no readable feed is tried at
/feed,/rss,/feed.xml,/rss.xml,/atom.xml,/index.xmland/feed.json.
Feeds the user already follows are marked and can’t be picked. Moved feeds (
301,308) are listed at their new address. -
Follow. With an optional name and tags. A source nobody follows yet is fetched right away, so its items are in the stream when the page answers. If that first fetch fails, nothing is kept: no subscription, no source, no tags. A source others already follow is shared and, when its fetches work, not fetched again; the new subscriber gets its latest 50 items. One whose fetches fail (a dead feed another user imported) is checked like a new source. A leftover source nobody follows is removed with a failed follow only if it has no items, so starred items of former subscribers stay.
Every fetch goes through the fetcher’s limits and its block on private addresses (feeds.md).
Changing a source
Edit on a row opens the editor under it:
- Weight: a slider in five steps, Much less, Less, Neutral (the default), More, Much more (below).
- Name: the user’s own. Empty means the feed’s title (shown as the placeholder).
- Tags: chips, like Inoreader folders. Typing suggests your tags (see Tag field). Whitespace is tidied, and case doesn’t make a new tag: “news” is the existing “News”. At most 20 per source, 60 characters each. A tag no source carries any more is removed. Renaming, merging and deleting tags across all sources is on the Tags page.
- Paused: the source’s items leave the stream (they aren’t deleted), and it isn’t fetched unless someone else follows it.
- Always load the full article: new items get the article from their page, for feeds that only send teasers (stream.md).
- Always show: the source’s items skip the AI gate and are never filtered out, such as a favorite podcast whose feed text is only a teaser (gate.md). It applies at once, also to items filtered before.
- Notify me: the source’s new items send a push while push is limited to chosen sources (notifications.md). The bell on the row turns it on and off without opening the editor.
- Unsubscribe…: after a confirmation. The user’s items from the source go, starred ones stay. The source row itself stays for retention to clean up.
The editor also says where the source’s items come from: an RSS feed, a YouTube channel, GitHub releases, a web page, a JSON API or links you added, and the address it fetches (a JSON API’s without its mapping, a web page’s without its recipe). A web page’s editor has its recipe, to make again with AI, fix, preview and save; a broken recipe shows Recipe broken on the row (source-types.md). Added links are never fetched, so their row has no next check and no Refresh now.
Weight
How much a source counts when the stream is ranked for you (SI-538): trusted sources higher, noisy ones lower. It’s stored per subscription (subscriptions.weight), so two users can weigh one source differently.
| Step | Weight |
|---|---|
| Much less | 0.25 |
| Less | 0.5 |
| Neutral (default) | 1 |
| More | 1.5 |
| Much more | 2 |
The API takes any weight from 0.1 to 2, rounded to two places, such as 1.25. The slider shows the nearest step, and leaves a weight between steps as it is until the slider is moved. A row whose weight isn’t neutral shows it (“Weight: More”), and the reader says where the item comes from and its weight: “RSS feed · Weight: More”. Stream items carry sourceWeight.
The For you order reads the weight: Much more is one point, Much less minus two (ranking.md). Newest first ignores it. The agent (SI-549) is meant to change weights too, through the same PATCH. Pausing and unsubscribing are the switches above; a weight never hides a source.
The list filters in the browser by name, address or tag, and by status (failing or dead), paused, or one tag. /sources?tag=News opens it filtered by that tag; the Tags page links there. Manage tags next to the filters opens the Tags page.
Sorting
A click on a column header sorts by that column; a second click reverses it. The header shows the direction with an arrow and aria-sort. The first click sorts:
| Column | First click |
|---|---|
| Source | A to Z |
| Status | Worst first: dead, failing, hibernating, OK |
| Last check, Newest item | Most recent first |
| Next check | Soonest first (“Now” before any time) |
| Interval | Shortest first |
Empty values (never checked, no items) go last both ways. Ties go by name. Sorting works on top of the filters. The sort is kept per device in localStorage (hotaru:sources-sort), like the reading preferences, not in the URL. On phones only the Source and Status columns show, so only those can be sorted there.
API
All need a write token except the GET.
| Request | |
|---|---|
POST /api/v1/sources/discover { url } |
The feeds at an address, each with subscriptionId when already followed. 422 with a message when there is none. A POST because the server fetches the address. |
POST /api/v1/subscriptions { url, title?, tags?, type?, mapping?, recipe? } |
Follows a feed. 201 with the subscription and the first fetch, 200 when already followed (nothing changes), 422 when the first fetch fails. type: 'github' follows a repository’s releases (url may be owner/repo), mapping a JSON API, recipe a web page (source-types.md). |
POST /api/v1/sources/preview { url, mapping } or { url, recipe } |
What a JSON API with a field mapping, or a web page with a recipe, would bring, without following it. |
POST /api/v1/sources/recipe { url } |
Makes a web page’s recipe with AI (paid). |
PUT /api/v1/subscriptions/:id/recipe { recipe } |
A new recipe for a web page you follow, for you alone, fetched at once (source-types.md). |
GET /api/v1/subscriptions/:id |
One subscription. |
PATCH /api/v1/subscriptions/:id { title?, paused?, tags?, fullArticle?, alwaysShow?, notify?, weight? } |
Changes what is sent. title: null or "" resets the name, tags replaces all tags, weight is 0.1–2 (400 outside). |
DELETE /api/v1/subscriptions/:id |
Unsubscribes. 204. |
The SDK has discover(), subscribe(), updateSubscription() and unsubscribe(). Subscriptions now also carry customTitle and sourceTitle, next to the title that is shown.