scholar2readpaper

jump from google scholar to readpaper

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

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

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

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

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

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

(I already have a user script manager, let me install it!)

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.

(I already have a user style manager, let me install it!)

// ==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'));
});
})();