Zhihu archive

Automatically archive zhihu page 众所周知,知乎内容经常被小管家咔擦。安装本脚本后,访问知乎内容时会自动向 https://web.archive.org/ 申请存档对应的 www.fxzhihu.com 页面

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Zhihu archive
// @namespace    http://www.zhihu.com/
// @version      0.4
// @description  Automatically archive zhihu page 众所周知,知乎内容经常被小管家咔擦。安装本脚本后,访问知乎内容时会自动向 https://web.archive.org/ 申请存档对应的 www.fxzhihu.com 页面
// @author       Jinzhe Zeng
// @match        https://www.zhihu.com/question/*
// @match        https://www.zhihu.com/question/*/answer/*
// @match        https://zhuanlan.zhihu.com/p/*
// @grant       GM_xmlhttpRequest
// @connect     web.archive.org
// @license LGPL-3.0-or-later; https://www.gnu.org/licenses/lgpl-3.0.txt
// ==/UserScript==

(function() {
    'use strict';

    var url = window.location.href.replace('zhihu.com', 'fxzhihu.com');
    GM_xmlhttpRequest ( {
    method:     'GET',
    url:        'https://web.archive.org/save/'+url,
    onload:     function (responseDetails) {
        console.log (
            "Save " + url + " successfully:\n",
            "See https://web.archive.org/web/*/"+url
        );
    }
} );
})();