Advertisement
darkenvy

Untitled

Feb 26th, 2016
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         CoinBrawl ForumPlus
  3. // @namespace    http://tampermonkey.net/
  4. // @version      0.1
  5. // @description  try to take over the world!
  6. // @author       You
  7. // @match        https://www.coinbrawl.com/message_threads/*
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11.  
  12. //document.body.innerHTML = document.body.innerHTML.replace('idea', '😀');
  13.  
  14.  
  15.  
  16. //'<h4><a href="/users/46720">Darkenvy</a></h4>'
  17. userName   = '\<h4\>\<a\shref="\/users\/\d+"\>(.*)\<\/a\>\<\/h4\>';
  18. avatar   = '😀';
  19.  
  20.  
  21. var re = /\<h4\>\<a\shref="\/users\/(\d+)"\>.*\<\/a\>\<\/h4\>/;
  22.  
  23. function findAvatar(userID) {
  24.     a = userID.match(/\d+/)
  25.     //a = userID;
  26.     //b = a.substring(1, a.length);
  27.    
  28.     //b = a / 151;
  29.     //c = Math.round(userID);
  30.     return a;
  31. }
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40. for(i = 0; i < 20; i++) {
  41.     document.body.innerHTML = document.body.innerHTML.replace( re, findAvatar('$1') );
  42.  
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement