I was recently generating some pages from data dump content, and noticed something problematic: links to Amazon books/products in the data dump HTML are still rewritten to use Stack Overflow's affiliate redirect, instead of the original link the user provided. For example:

<p>A bit more specific, it's Local Common Subexpression Elimination. An algorithm is given in <a href="http://rads.stackoverflow.com/amzn/click/0321486811" rel="nofollow">Dragon Book</a>

You can see this Data Explorer query to confirm; there are many times more rads.stackoverflow.com URLs in dumped post bodies than www.amazon.com links.

Given that one of the main purposes of the data dump is to be an archival resource in the event that Stack Exchange goes away, it is suboptimal for these links to depend on Stack. Could this be fixed?

I realize that this could a custom rebake of every post to do properly, but y'all are smart.

It is still possible to get the original URLs from the markdown source in the PostHistory table. However, I have had difficulty using this approach in bulk because of edge cases in Stack's markdown renderer that don't match the libraries I have available in other languages. Including a WASM-compiled version of the render in the data dump would also be an acceptable solution. 😉

  • 3
    A similar problem exists for snippets, for embedded youtube videos on sites that support those, for the chess board plugin, etc... Are you asking for this to be done for just the amazon links, or all cases where markdown and rendered body differ significantly. – Shog9 Mar 14 '18 at 17:01
  • 1
    Good question, I hadn't fully considered that. It probably makes sense to remove any custom formatting that adds dependnecies, which may be all of them. (If the youtube one just generated an inline iframe, so it's still just referencing youtube.com directly without requiring any supporting script, that might be fine to leave in. If it uses the JS API to render those, maybe not.) – Jeremy Banks Mar 14 '18 at 17:17
  • But... are Amazon links eternal? Won't they go away faster than SO links? – user1228 Mar 15 '18 at 16:50
  • 2
    @Won't I'll certainly hope that Stack outlives Amazon, but I'd rather have one point of failure than two for each such link. It's not a big deal, though. – Jeremy Banks Mar 15 '18 at 16:51
  • 1
    @Won't I have an example of an Amazon link that now goes to 404, whereas it previously went to a product I purchased. As well as another link which now goes to a totally different item, because Amazon repurposed the same ASIN for the different product. – Sonic the Masked Werehog Mar 21 '18 at 23:50

You must log in to answer this question.

Browse other questions tagged .