scholar2readpaper

jump from google scholar to readpaper

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 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         scholar2readpaper
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  jump from google scholar to readpaper
// @author       Yuhang
// @include      https://scholar.google.*/*
// @grant        none
// @license MIT

// ==/UserScript==

(function() {
var papers = document.querySelectorAll('.gs_ri');

console.log(papers)
papers.forEach(function(item){
    var title = item.querySelector("a").innerText;
    var newurl = 'https://readpaper.com/search/'+encodeURIComponent(title);
    var loc = item.getElementsByClassName("gs_ggs gs_fl");

    var obj1 = document.createElement("a");
    obj1.href = newurl;
    obj1.target = '_blank';
    obj1.appendChild(document.createTextNode('ReadPaper'));
	item.querySelector('.gs_ri .gs_fl').insertBefore(obj1,item.querySelector('.gs_ri .gs_fl .gs_or_mor'));
});
})();