autolink
This article is a stub. You can help the IndieWeb wiki by expanding it.
An autolink is a hyperlink that was automatically added to some text to link that text to an obvious or useful destination, like hyperlinking a URL in plaintext to the URL itself, linking hashtags to search results, and @-names to their profile pages.
IndieWeb Examples
Tantek
Tantek Γelik posts plain text notes on tantek.com which are autolinked (URLs, @-names) with the CASSIS auto_link
function since 2010-02-16.
Hans Gerwitz
Hans Gerwitz renders notes with a Markdown processor that autolinks URLs for him at publish-time, but intends to implement view-time after suffering the pain of importing thousands of pre-processed notes from Twitter.
... many more ...
Feel free to add your site if you also support posting of notes with autolinking, and note since when.
Open Source
PHP
See CASSIS auto_link
function for a fairly good (and selfdogfooded) open source autolink implementation for PHP&JS.
Python
There is a python version of the Cassis auto-link code.
IndieWeb Utils implements an autolink function called `autolink_tags`. This function lets you add custom links to hashtags and @ person tags. View the documentation for this function.
Silo Examples
Most silos autolink URLs, some autolink hashtags & @-names as well (Twitter, Instagram).
On Publish Or View
It deserves consideration whether autolinking is applied at the time of publishing or the time of viewing.
In favor of publish-time:
- process once
- preserve author intent
In favor of view-time
- adapt to changing link targets
- allow for user preferences (e.g. what site should a #hashtag or @username link to?)
Brainstorming
New ideas for autolinking to consider implementing.
Flight status and tracking
Flight codes could be auto-linked to the current (today's?) flight using two letter airline code and flight number e.g. (without requiring JS)
Or for a specific date by appending /YYYY/MM/DD to the end e.g.:
Live flight info with map (requires JS): FlightAware links can be automatically constructed from flight codes! E.g.
- Flight code: UA59
- Link to live status / map: https://flightaware.com/live/flight/UA59
- Useful if you know the flight is happening (via external information, or retrieval of
Reference:
- Airline codes (IATA two letter, and three letter) https://en.wikipedia.org/wiki/List_of_airline_codes
- flight numbers seem to be 1-4 digits (0-9).
Regex:
- Could probably construct a regex of 2-3 airline codes (uppercase only) followed by (optional space) followed by 1-4 digits (0-9)
See Also
- http://en.wikipedia.org/wiki/AutoLink
- auto-embed
- auto-space
- auto-tag
- auto-url-summary
- link-preview
- hashtag
- CASSIS
- https://twitter.com/jjdelc/status/1104809310721372160
- "In a similar note, given an @mention to someone, when parsing it, how to decide where to link? to a Twitter profile, IG profile (assuming they use the same handle in both). Keep an @-2-url map in my code? #indieweb https://jj.isgeek.net/2019/03/10-182039/" @jjdelc March 10, 2019
- https://twitter.com/jjdelc/status/1104808804217163776
- "Where is the best place to universally link to content matching a #hashtag? To Twitter's results? To Instagram? To some aggregator that'll die next year? #indieweb https://jj.isgeek.net/2019/03/10-181838/" @jjdelc March 10, 2019
- https://xoxo.zone/@KevinMarks/112491438991835457
- "@janeadams @vonxylofon @baldur well, there is the one @tantek.com uses to match valid URLs to auto-link them; That's quite impressive and I wouldn't trust an LLM to make it.
https://github.com/tantek/cassis/blob/main/cassis.js#L1313" @KevinMarks May 23, 2024
- "@janeadams @vonxylofon @baldur well, there is the one @tantek.com uses to match valid URLs to auto-link them; That's quite impressive and I wouldn't trust an LLM to make it.