auto-url-summary

From IndieWeb


An auto-url-summary is brief, human-readable text generated automatically from the parts of a URL, often using special knowledge about the URL structures at particular domains, as a way to provide a summary of what the URL is about, instead of (or before) accessing the URL itself and reading the microformats there for more information.

Why

In general auto-url-summary is useful when for some reason it is not possible (or not desirable) to retrieve the URL and parse it for microformats to generate an actual summary. Some reasons:

  • simpler to code
  • offline support
  • user preference to minimize indirect loading, e.g. performance considerations for a low bandwidth connection, or perhaps privacy
  • text placeholder while lazy loading the URL
  • no easily discernible information at the URL itself, e.g. it returns apparent gibberish, a binary format, random JSON/XML/etc.

Specific use-cases where this is useful:

Minimal reply context

An auto-url-summary can be used to generate a minimal text reply context.

Link preview

Similarly, an auto-url-summary may be used to provide a text-only link preview.

IndieWeb Examples

Tantek

Tantek ร‡elik has been generating and displaying auto-url-summaries in in-stream minimal text reply contexts since 2018-02-19 using an experimental CASSIS function: auto_url_summary (selfdogfooding on his own site)

... more ...

Feel free to add your site if you also use auto-url-summary anywhere in your personal site / posting UI, and note since when.

Open Source

PHP

See the CASSIS experimental auto_url_summary function for a start at a decent (and selfdogfooded) open source auto_url_summary implementation for PHP&JS.

Python

IndieWeb Utils has implemented a variant of the CASSIS auto_url_summary in Python. View the IndieWeb Utils documentation for this function.

Brainstorming

English design

Copied from minimal text reply contexts:

  • if URL is a tweet permalink of user aaronpk,

    @aaronpkโ€™s tweet

  • else if URL is a Github issue comment permalink (github.com/owner/xyz/issues/n#issuecomment-m),

    a comment on issue #n of GitHub project xyz

  • else if URL is a Github issue (github.com/owner/xyz/issues/n),

    issue n of GitHub project xyz

  • else if URL is a Github repo or issues list (github.com/owner/xyz or github.com/owner/xyz/issues optional trailing /),

    GitHub project xyz

  • else

    URL

Feel free to expand with suggestions for other domains / URL patterns.

CASSIS auto_url_summary improvements

Some ideas I had for improving the CASSIS auto_url_summary function. - Tantek ร‡elik

  • Bool param: solo recognized only, default false
  • recognize nicknames-cache primary domain, get text name (rather than account path / alias), and use that for

    nameโ€™s post

    (or tweet for @-names etc.)

These brainstorms may be more relevant on reply-context, but keeping here for now in context of other auto-url-summary related improvements.

  • use as a fallback for h-cite parsing (especially of an in-reply-to h-cite on a post), if the h-cite lacks an explicit p-summary and p-name. E.g.
    • Parse & load in-reply-to h-cite
    • explicit summary if any
    • explicit name if any
    • If neither then imply name
    • Display:
      • name -> "post"
      • else summary -> "note"

Next:

  • Display: first check if h-cite has in-reply-to -> "reply"

Next:

  • Attempt loading of in-reply-to URL
    • Retrieve reply-context h-cite at publish preview time
    • Cache reply-context h-cite at post time
    • Load additional h-cite fields
      • Author: name, photo, url

See Also