Bypass paywalls for scientific documents

Bypass paywalls for scientific documents by downloading them from sci-hub instead of paying something like 50 bucks for each paper. This script adds download buttons on Scopus and Web Of Science, which lead to sci-hub.bz. In this way you can get free access to scientific papers even if you (or your university) can't afford their prices.

当前为 2017-11-23 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         Bypass paywalls for scientific documents
// @namespace    StephenP
// @version      2.0
// @description  Bypass paywalls for scientific documents by downloading them from sci-hub instead of paying something like 50 bucks for each paper. This script adds download buttons on Scopus and Web Of Science, which lead to sci-hub.bz. In this way you can get free access to scientific papers even if you (or your university) can't afford their prices.
// @author       StephenP
// @match        https://www.scopus.com/record/display.uri?*
// @match        https://apps.webofknowledge.com/full_record.do?*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';
    //If Sci-Hub address changes, just replace the URL below with the new one
    var sciHubUrl='http://sci-hub.bz/';
    var doi;
    var site=window.location.href.toString();
    var donate='window.open(\"'+sciHubUrl+'#donate\");';
    if(site.startsWith("https://www.scopus.com/")){
        var fullDocument=document.querySelector('[title="Full Text(opens in a new window)"]');
        doi=document.getElementById("recordDOI").innerHTML;
        var section=document.getElementById("outwardLinks");
        section.removeChild(section.lastChild);
        fullDocument.parentNode.insertAdjacentHTML('beforeend','<a href="'+sciHubUrl+doi+'"><img class="outwardLink" src="data:image/gif;base64, R0lGODlhZQAPAKU2AGZmZghapZmZmYD//8rKyunr6enq6urr6erq6uzt7Ozt7e3t7O3t7e3u7e3u7u7u7e7u7u/v8O/w7+/w8PDw7/Ly8vLz8vLz8/Py8vPz8vPz8/P09PT08/T09PX19vX29fX29vb19fb29ff39/f49/j4+Pj5+Pj5+fn4+Pn4+fn5+Pn5+fn6+vr6+fr6+v39/f39/v3+/f3+/v79/f7+/f7+/v///////////////////////////////////////yH5BAEKAD8ALAAAAABlAA8AAAb+wJ9gSCwaj8ikcslsOpNCm3RKrVqv2Kx2y+1eawCBDfaKyV4vckydLrNj7XX5HGer1fR7uY5H6+F/fXV7fzEEYTYuLIsujYyMiiyRkI+QkZeXi5KOkpSbmo2Zn52km6KNAQGXh2KpJionJ66uJyUrJrYmt7W3ubC8uLu5Jam/wyupySW+scQBucCutqnNvcKpuSasNiSpI9+pJCQj4+Xl5Oji6N/m6eTdAd/p8OgB6uPs7+7w6t7z6eHebfOQ6kOIVCI+FAxBMJnCAAxTeRCRKgTDhA0dJqs48UPDix4nbmzYEWRBkRAPBvDIcWMAD9s6pOogM8CGmjRn1twwMxn+zwA0O9wUmhMozqBDXQbVWZQozZsudUo1OvPnNgsZUmlIlcFCKgtbXWYN4NXrWA0asFrAunHtV7Rq2bb1Shbu17Ffv8pFq1crXbnbIkTYKFhCKsMBIkgoPDiZ4cGLBStuLDjA4sOSJ2tO1VhCZMqaFWMGjZkz6QDbHEDYqNpBKtWvYUNw/TrZAwizZ7/W7YD27dy9A7SOneo37dbAY68OgJs48+PLtylIkCDZ9OoBqCtwST1V91QLtGvnPj1ZguvbN54vbz3V9fPf4XvHrj69+W0IDhQwcOBA/gL/+adfgAUICKB+/BkY4H//Jcigfgo22N+DBVIooYIQUmjANgQndOjhhyCGKOKIJJZo4okoigjADwC06OKLMMYo44w01mjjjTjO+EMQADs=" alt="Download from Sci-Hub" title="Full Text(opens in a new window)" height="15" width="101"></a><a style="font-size: 12px; color: green; text-decoration: underline;" href="javascript:;">Donate to Sci-Hub project</a><span class="divider">|</span>');
        fullDocument.parentNode.children[5].setAttribute('onclick',donate);
    }
    else if(site.startsWith("https://apps.webofknowledge.com/")){
        doi=document.getElementsByClassName("block-record-info block-record-info-source")[0].children[4].children[1].innerHTML;
        var list=document.getElementsByClassName("popup-ft-list")[0];
        list.appendChild(list.children[1].cloneNode(true));
        var sciHubBtn=list.children[2].children[0].children[0];
        sciHubBtn.innerHTML="Full Text from Sci-Hub";
        sciHubBtn.setAttribute('onclick',('window.open(\"'+sciHubUrl+doi+'\");'));
        list.insertAdjacentHTML('beforeend','<li><a style="font-size: 12px; color: green; text-decoration: underline;" href="javascript:;">Donate to Sci-Hub project</a></li>');
        list.lastChild.lastChild.setAttribute('onclick',donate);
    }
})();