cofacts / rumors-site

Rumors list / creation UI, with server-side rendering
https://cofacts.tw
MIT License
82 stars 48 forks source link

Add links to Wayback Machine for all link previews in Cofacts #576

Open MrOrz opened 2 months ago

MrOrz commented 2 months ago

From: https://g0v.hackmd.io/IrRBabPXQBOVQTjSNlIdwg?both=#Wayback-machine-API

Starting from https://github.com/cofacts/rumors-api/releases/tag/release%2F20240904 , we are sending all hyperlinks in articles and replies to Wayback Machine to preserve their content, so that the content can be still accessible after the link is broken.

Given a canonical URL (the URL after URL redirection), what the Wayback Machine stores are:

We should make these links visible in the URL preview section (similar to Google's Archive 頁庫存檔) so that readers know that they can visit the archive if the original link is broken. We will not test if the link is broken, though.

Need a design and implementation on this matter.


Example: https://cofacts.tw/article/2hdrdvdvpuebp

image

Chious commented 1 month ago

Wayback Machine provide API that would give all the copy in db.

e.g. : https://archive.org/wayback/available?url=https://news.ltn.com.tw/news/life/paper/1659980

it would return

{"url": "https://news.ltn.com.tw/news/life/paper/1659980", "archived_snapshots": {"closest": {"status": "200", "available": true, "url": "http://web.archive.org/web/20240902121756/https://news.ltn.com.tw/news/life/paper/1659980", "timestamp": "20240902121756"}}}

we could call this api after user click the archive button.