Advertisement
Guest User

Fanboi.ch Greentext

a guest
Jan 1st, 2020
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name        Fanboi.ch Greentext
  3. // @namespace   Violentmonkey Scripts
  4. // @match       *://*/*
  5. // @include     https://fanboi.ch/*
  6. // @grant       none
  7. // @version     1.0
  8. // @author      Gu
  9. // @description 1/1/2020, 9:04:43 PM
  10. // ==/UserScript==
  11.  
  12. var posts = document.querySelectorAll(".post");
  13.  
  14. posts.forEach(function(post){
  15.     post.querySelectorAll("p").forEach(function(p){
  16.     var lines = p.innerHTML.split("<br>");
  17.     var greentext = [];
  18.     lines.forEach (function(text){
  19.       greentext.push(text.replace(/(^&gt;(?!&gt;).*)/, "<span class=\"quote\">$1</span>"));
  20.     });
  21.     p.innerHTML = greentext.join("<br>");
  22.   });
  23. });
  24.  
  25. document.body.innerHTML += "<style>.quote {color:green} </style>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement