- Rust 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
|
|
||
| cli | ||
| docs | ||
| src | ||
| tests | ||
| .gitignore | ||
| Cargo.lock | ||
| Cargo.toml | ||
| LICENSE | ||
| README.md | ||
sable-link-preview
Link previews for Matrix, shared by Soliditas and the Sable client.
PreviewDatareads a preview from a/preview_urlanswer or from bundledm.url_previews, treating every field from a stranger as optional.BundleEntrywrites one entry ofm.url_previews(andcom.beeper.linkpreviews).scrape(featurescrape) builds a preview from the page: Open Graph tags, filled from Twitter card tags,<title>,<meta name="description">and oEmbed. Twitter/X links come from the FxTwitter API, Bluesky posts from their author's PDS (resolved through Slingshot, counts from Constellation), Reddit and TikTok titles from their oEmbed endpoints, Klipy GIFs, stickers and clips from the Klipy API whenScrapeOptionshas a key, Tumblr posts without an image get the fxtumblr render, and fediverse posts (Mastodon, Misskey and others) are read from their ActivityPub object.ReqwestFetch(featurereqwest) runs a scrape overreqwest, connecting only to public addresses and refusing redirects to local hosts.TunnelFetch(featuretunnel) runs a scrape through a tunnel relay, natively and in the browser. Each TCP connection is one WebSocket to the relay, which resolves the host name and refuses non-public addresses, and a request fails instead of connecting directly when the relay is unreachable.
scrape takes any Fetch implementation, so it runs on a Cloudflare Worker through fetch as well as natively.
Posts
Every post preview, from X, Bluesky, the fediverse, Tumblr, Reddit, TikTok or a page that declares og:type note itself, follows Sable's Open Graph note extension: og:type note with note: keys, and a quoted post under related:1:. They sit with the other keys, in a /preview_url answer and in bundled m.url_previews entries (MSC4095). Clients that do not read them still get og:title (Name (@handle)), og:description (the text) and og:image (the first image).
{
"og:type": "note",
"note:author": "Alice",
"note:author:handle": "alice.example",
"note:author:url": "https://bsky.app/profile/alice.example",
"note:author:image": "mxc://example.org/avatar",
"note:content": "hello",
"note:published_time": "2026-10-12T00:00:00.000Z",
"note:relation": ["like", "boost", "reply", "quoted_note"],
"note:relation:like": "7",
"note:relation:boost": "2",
"note:relation:reply": "3",
"note:relation:quoted_note": "1",
"note:sensitivity": "spoiler",
"note:sensitivity:reason": "Star Wars",
"og:image": "mxc://example.org/cat",
"og:image:type": "image/png",
"og:image:alt": "a cat",
"og:image:1": "mxc://example.org/dog",
"og:video": "mxc://example.org/clip",
"og:video:type": "video/mp4",
"og:video:com.sable.gif": true,
"related:1:og:type": "note",
"related:1:og:url": "https://bsky.app/profile/bob.example/post/3def",
"related:1:note:content": "the quoted post"
}
An og:video that comes with a GIF image, as on Tenor and GIPHY, gets og:video:com.sable.gif.
docs/note-extension.md describes how notes are written in JSON: numbered images and videos, uploaded and encrypted media, how a sensitive note keeps its media from clients that do not read notes, and the keys Sable adds.
License
AGPL-3.0-or-later, see LICENSE.
The scraper is ported from Soliditas, Copyright 2026 Rye, licensed under the Apache License 2.0.