daily pastebin goal
19%
SHARE
TWEET

Untitled

a guest Feb 23rd, 2017 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Author: Blahma, license: CC-BY-SA
  2. var credible = [];
  3. function showmypatrol(data) {
  4.   $.each(data.query.users, function(k,v) { credible[v.name] = (v.groups && v.groups.indexOf('autopatrolled')!=-1) });
  5.   $('.mw-userlink').each(function () { if(!credible[$(this).text()]) $(this).parent().addClass('not-patrolled'); });
  6.   }
  7. function gomypatrol() {
  8.   var url = 'https://cs.wikipedia.org/w/api.php?action=query&list=users&ususers=' + $('.mw-userlink').map(function(i,v) {return $(this).text();}).toArray().filter(function(v,i,s){ return s.indexOf(v)===i}).join('|') + '&usprop=groups&format=json';
  9.   $.getJSON(url, function(data) { showmypatrol(data); });
  10.   }
  11. function trymypatrol() {
  12.   if(wgCanonicalSpecialPageName == 'Newpages' || wgCanonicalSpecialPageName == 'Recentchanges' || wgCanonicalSpecialPageName == 'Watchlist') gomypatrol();
  13.   }
  14. $(trymypatrol);
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