Karma Plus

Add a link to the Karma URL in the user profile page

  1. // ==UserScript==
  2. // @name Karma Plus
  3. // @grant none
  4. // @include http://forums.e-hentai.org/index.php?showuser=*
  5. // @version 0.0.1.20150615030051
  6. // @namespace https://greasyfork.org/users/2233
  7. // @description Add a link to the Karma URL in the user profile page
  8. // ==/UserScript==
  9.  
  10. var wnd = window
  11. var doc = wnd.document
  12. var loc = location
  13. var href = loc.href
  14.  
  15. var $ = function(e, css) { if(!css) { css=e; e=doc }; return e.querySelector(css) }
  16. var $$ = function(e, css) { if(!css) { css=e; e=doc }; return e.querySelectorAll(css) }
  17.  
  18. if(/\?.*&?\bshowuser=/.test(href)) {
  19. var a = doc.createElement('a')
  20. a.href = 'http://e-hentai.org/dmspublic/karma.php?u=' + href.match(/\?.*&?\bshowuser=(\d+)/)[1]
  21. a.text = 'Karma+'
  22. $('#profilename').appendChild(doc.createElement('br'))
  23. $('#profilename').appendChild(doc.createElement('br'))
  24. $('#profilename').appendChild(a)
  25. }