Last active
November 10, 2022 05:34
-
-
Save nathanpeck/bd48f498e1bc4a2316bd652b85673cc8 to your computer and use it in GitHub Desktop.
Revisions
-
nathanpeck revised this gist
Nov 10, 2022 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -26,6 +26,18 @@ function check(changes, observer) { var altText = htmlToElement("<b style='background-color: #1DA1F2; color: white; padding-left: 4px; padding-right: 4px; margin-left: 5px;'>L</b>"); badge.parentNode.replaceChild(altText, badge); } var xpath = "//span[contains(text(),'subscribed to Twitter Blue')]"; var matchingElement = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; if (matchingElement) { matchingElement.innerText = 'This account takes a fat L because they paid for Twitter Blue.'; xpath = "//span[contains(text(),'Verified account')]"; matchingElement = document.evaluate(xpath, document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; if (matchingElement) { matchingElement.innerText = 'Verified L'; } } } (function() { -
nathanpeck revised this gist
Nov 10, 2022 . 1 changed file with 11 additions and 15 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -14,25 +14,21 @@ * @return {Element} */ function htmlToElement(html) { var template = document.createElement('template'); html = html.trim(); // Never return a text node of whitespace as the result template.innerHTML = html; return template.content.firstChild; } function check(changes, observer) { var list = document.querySelectorAll('[aria-label="Verified account"]'); for (var badge of list) { var altText = htmlToElement("<b style='background-color: #1DA1F2; color: white; padding-left: 4px; padding-right: 4px; margin-left: 5px;'>L</b>"); badge.parentNode.replaceChild(altText, badge); } } (function() { 'use strict'; (new MutationObserver(check)).observe(document, {childList: true, subtree: true}); })(); -
nathanpeck revised this gist
Nov 9, 2022 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -21,7 +21,6 @@ function htmlToElement(html) { } function check(changes, observer) { for (const mutation of changes) { if (mutation.type === 'childList') { var list = document.querySelectorAll('[aria-label="Verified account"]'); -
nathanpeck revised this gist
Nov 9, 2022 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,7 @@ // @version 0.1 // @description Replace Twitter Verified badge with a fat L // @author You // @match https://twitter.com/* // @icon // @grant none // ==/UserScript== @@ -20,6 +21,7 @@ function htmlToElement(html) { } function check(changes, observer) { for (const mutation of changes) { if (mutation.type === 'childList') { var list = document.querySelectorAll('[aria-label="Verified account"]'); -
nathanpeck revised this gist
Nov 9, 2022 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -20,7 +20,6 @@ function htmlToElement(html) { } function check(changes, observer) { for (const mutation of changes) { if (mutation.type === 'childList') { var list = document.querySelectorAll('[aria-label="Verified account"]'); -
nathanpeck revised this gist
Nov 9, 2022 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ // @version 0.1 // @description Replace Twitter Verified badge with a fat L // @author You // @icon // @grant none // ==/UserScript== -
nathanpeck created this gist
Nov 9, 2022 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ // ==UserScript== // @name Twitter L's // @namespace http://tampermonkey.net/ // @version 0.1 // @description Replace Twitter Verified badge with a fat L // @author You // @icon // @grant none // ==/UserScript== /** * @param {String} HTML representing a single element * @return {Element} */ function htmlToElement(html) { var template = document.createElement('template'); html = html.trim(); // Never return a text node of whitespace as the result template.innerHTML = html; return template.content.firstChild; } function check(changes, observer) { for (const mutation of changes) { if (mutation.type === 'childList') { var list = document.querySelectorAll('[aria-label="Verified account"]'); for (var badge of list) { var altText = htmlToElement("<b style='background-color: #1DA1F2; color: white; padding-left: 4px; padding-right: 4px; margin-left: 5px;'>L</b>"); badge.parentNode.replaceChild(altText, badge); } } } } (function() { 'use strict'; (new MutationObserver(check)).observe(document, {childList: true, subtree: true}); })();