Last active
September 16, 2017 16:16
-
-
Save TehShrike/19a32bdc619d5dbcd2e7 to your computer and use it in GitHub Desktop.
Gimme the ASIN
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
| javascript:(function() { | |
| function getFromUrl(url) { | |
| return url.match(RegExp("https?://www.amazon.com/([\\w-]+/)?(dp|gp/product)/(\\w+/)?(\\w{10})"))[4] | |
| } | |
| document.body.innerHTML = '<h1>::asin|' + getFromUrl(Array.prototype.slice.apply(document.getElementsByTagName('link')).filter(function(element) { return element.attributes.getNamedItem('rel').value === 'canonical' })[0].href) + '|Title::</h1>' | |
| })() |
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
| javascript:(function() { function getFromUrl(url) { return url.match(RegExp("https?://www.amazon.com/([\\w-]+/)?(dp|gp/product)/(\\w+/)?(\\w{10})"))[4] } document.body.innerHTML = '<h1>::asin|' + getFromUrl(Array.prototype.slice.apply(document.getElementsByTagName('link')).filter(function(element) { return element.attributes.getNamedItem('rel').value === 'canonical' })[0].href) + '|Title::</h1>' })() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment