autolink

From IndieWeb
(Redirected from AutoLink)


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.

Reference:

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