Last active
October 21, 2021 10:40
-
-
Save jenkoian/0277f7e23b0b74987df3f6a2e60b3388 to your computer and use it in GitHub Desktop.
Bookmarklet code to make all the 'Where to watch' links on Robtober point to the UK version and removes the links to buy tickets for US shows (create a new bookmark in your bookmark bar and replace the url with the code below) - https://v6.robweychert.com/blog/2021/10/robtober
This file contains 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(){const links = document.getElementsByClassName('film__link');for (const link of links) {if (link.textContent.toLowerCase().includes("where to watch")) {console.log('Replacing ' + link.getAttribute('href'));link.setAttribute('href', link.getAttribute('href').replace('/us/', '/uk/'));if (link.getAttribute('href').includes('malignant-2021')) {link.setAttribute('href', link.getAttribute('href').replace('malignant-2021', 'malignant'));}console.log(' with ' + link.getAttribute('href'));}}for (const link of links) {if (link.textContent.toLowerCase().includes( "tickets" )) {console.log('Remove tickets link from ' + link.closest('.film__description').querySelector('.film__title').textContent);link.parentNode.remove();}}})(); |
This file contains 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(){ | |
const links = document.getElementsByClassName('film__link'); | |
for (const link of links) { | |
if (link.textContent.toLowerCase().includes("where to watch")) { | |
console.log('Replacing ' + link.getAttribute('href')); | |
link.setAttribute('href', link.getAttribute('href').replace('/us/', '/uk/')); | |
if (link.getAttribute('href').includes('malignant-2021')) { | |
link.setAttribute('href', link.getAttribute('href').replace('malignant-2021', 'malignant')); | |
} | |
console.log(' with ' + link.getAttribute('href')); | |
} | |
} | |
for (const link of links) { | |
if (link.textContent.toLowerCase().includes( "tickets" )) { | |
console.log('Remove tickets link from ' + link.closest('.film__description').querySelector('.film__title').textContent); | |
link.parentNode.remove(); | |
} | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment