Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name AmazonToYaleLibrary
- // @namespace http://alexreinking.com/
- // @version 0.1
- // @description Find the ISBN numbers, and add an ORBIS search link by the book name.
- // @match http://www.amazon.com/*
- // @copyright 2014, Alex Reinking
- // @require http://code.jquery.com/jquery-latest.js
- // ==/UserScript==
- $(document).ready(function() {
- var isbn10 = $("#productDetailsTable .content li:contains('ISBN-10:')").text();
- var isbn13 = $("#productDetailsTable .content li:contains('ISBN-13:')").text();
- var isbn = isbn13;
- if (isbn == "") {
- isbn = isbn10;
- }
- isbn = isbn.split(':')[1].replace(/\D/g,'');
- var urlPre = "http://orbis.library.yale.edu/vwebv/search?searchArg1=";
- var urlPost = "&argType1=all&searchCode1=GKEY&combine2=and&searchArg2=&argType2=all&searchCode2=GKEY&combine3=and&searchArg3=&argType3=all&searchCode3=GKEY&year=2013-2014&fromYear=&toYear=&location=all&place=all&type=all&medium=all&language=all&recCount=50&searchType=2&page.search.search.button=Search";
- var wholeURL = urlPre + isbn + urlPost;
- $("#productTitle").append(" <a href='" + wholeURL + "'>(ORBIS Search)</a>");
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement