Created
January 7, 2017 21:36
-
-
Save marufsiddiqui/f9f822e994074f95f2fd421c9863a415 to your computer and use it in GitHub Desktop.
Amazon Offerlisting UserScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Amazon Offerlisting | |
// @version 1.0.6 | |
// @description Add CamelCamelCamel graph, link to Amazon product pages. | |
// @author Andrew Metzger | |
// @namespace http://static.nerdoncloud.com/userscripts/ | |
// @include https://www.amazon.de/* | |
// @require https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js | |
// ==/UserScript== | |
function addButton(prodId) { | |
var url = 'https://www.amazon.de/gp/offer-listing/' + prodId; | |
var link = '<a href=' + url + '>All Offers</a>'; | |
$('#titleSection').append(link); | |
} | |
$(document).ready(function () { | |
var url = document.location.href; | |
var regex = /([a-zA-Z0-9]{10})(?:[/?]|$)/; | |
var m = url.match(regex); | |
if (m) { | |
addButton(m[1]); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment