Advertisement
Guest User

Fanboi.ch Greentext 1.1

a guest
Jan 2nd, 2020
137
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. // @include     https://fanboi.ch/*
  5. // @grant       none
  6. // @version     1.1
  7. // @author      Gu
  8. // @description 1/1/2020, 9:04:43 PM
  9. // ==/UserScript==
  10.  
  11. var posts = document.querySelectorAll(".post");
  12.  
  13. posts.forEach(function(post){
  14.     post.querySelectorAll("p").forEach(function(p){
  15.     var lines = p.innerHTML.split("<br>");
  16.     var greentext = [];
  17.     lines.forEach (function(text){
  18.       greentext.push(text.replace(/(^&gt;(?!&gt;).*)/, "<span class=\"quote\">$1</span>"));
  19.     });
  20.     p.innerHTML = greentext.join("<br>");
  21.   });
  22. });
  23.  
  24. document.body.innerHTML += "<style>.quote {color:green} </style>"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement