SHARE
TWEET

DearDiaryMaker JS for CNN's @Acosta Twitter page

a guest Jan 23rd, 2019 11 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        Dear Diary Maker for Acosta on Twitter
  3. // @namespace   net.moralvolcano.js.dear_diary_acosta_twitter
  4. // @include     https://twitter.com/acosta/*
  5. // @version     1
  6. // @grant       none
  7. // ==/UserScript==
  8.  
  9. function handle_DOMLoaded() {
  10.     try {
  11.         window.setTimeout(
  12.             function() {
  13.                 changeAcostaTweets();
  14.             },
  15.             6*1000);
  16.     } catch (e) {
  17.         console.error("DDMFAT Error: " + e);
  18.     }
  19. }
  20.  
  21.  
  22. document.addEventListener("DOMContentLoaded", handle_DOMLoaded, false);
  23.  
  24. function changeAcostaTweets() {
  25.     console.error("DDMFAT Error: Loaded");
  26.     var arTags = document.getElementsByTagName("p");
  27.     for (var i = 0; i < arTags.length; i++) {
  28.         if (arTags[i].className.indexOf("tweet-text") > 0) {
  29.             arTags[i].innerHTML = "<marquee direction=\"down\" loop=\"1\" behavior=\"alternate\" style=\"height: 2em; width: 100%; \">Dear Diary,</marquee><br /><br /><blockquote style=\"margin-left: 3em;\">" + arTags[i].innerHTML + "</blockquote>";
  30.         }
  31.     }
  32.     var arDivs = document.getElementsByTagName("div");
  33.     for (var i = 0; i < arDivs.length; i++) {
  34.         if (arDivs[i].className.indexOf("tweet-stats-container") > 0) {
  35.             arDivs[i].parentNode.removeChild(arDivs[i]);
  36.             break;
  37.         }
  38.     }
  39. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top