4

There are currently 4 "magic columns" for query results:

  • [Post Link]
  • [User Link]
  • [Comment Link]
  • [Suggested Edit Link]

Which are great. However, it would be beneficial to be able to create a "magic column" for an arbitrary SO link generated by the query (I'm doing some data mining that is IMHO worthwhile, but is being hampered by this feature not being available).

To achieve this, my suggested syntax is:

  1. Any column name ending in " Link" is a "magic link"
  2. The url is http://[site.on.se].com/ plus the text in the column (where [site.on.se] is the site targeted by the query... e.g. stackoverflow, codereview.stackexchange, programmers.stackexchange, etc.)
  3. The text of the link is taken from the head of the text before a ':'

Items 1 and 2 are consistent with the current impl, especially item 2, which ensures that links to foreign sites are not allowed.

For example (with the User Link included for comparison):

select
    id [User Link], -- standard user profile magic link
    concat(name, '''s rep:users/', id, '?tab=reputation') [Reputation Link] -- custom link
from users

Would create this data:

  1. User Link --> nnnnnn
  2. Reputation Link --> Some User Name's rep:users/nnnnnn?tab=reputation'

And be rendered as:

  1. <a href="http://[site.on.se].com/users/nnnnnn">Some User Name</a>
  2. <a href="http://[site.on.se].com/users/nnnnnn?tab=reputation">Some User Name's rep</a>
8

The per-site autolinking seems to already cover this using the site://<path>|<text> syntax, as shown in this example query.

  • 2
    Oh dear... RTFM :/ – Bohemian Apr 6 '14 at 16:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .