Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name QuickDelete
- // @description Facilite la suppression de spam par MP sur jeuxvideo.com
- // @include http://www.jeuxvideo.com/messages-prives/boite-reception.php
- // @version 1.2
- // ==/UserScript==
- function analyserPage() {
- $('.sujet>a').each(function() {
- var lienCourant = $(this);
- $.ajax({
- url: lienCourant.attr('href'),
- dataType: 'text',
- type: 'GET',
- success: function(p){
- // XMLisation parce que sinon jQuery stoppera aux erreurs
- var h = document.createElement('div');
- h.innerHTML = p;
- if(analyserMP(h))
- surlignerMP(lienCourant.parent().parent());
- }
- });
- });
- }
- function analyserMP(mp) {
- // Discussion fermée et 0 messages
- if(mp.getElementsByClassName('fermer').length == 1 && mp.getElementsByClassName('msg').length == 2)
- {
- return true;
- }
- // Gens qui quittent
- if(mp.getElementsByClassName('liste_pseudos_elm').length > 10) {
- var rageQuits = 0;
- for(var i in mp.getElementsByClassName('generic')) {
- // Ne pas en prendre en compte les kick
- if(mp.getElementsByClassName('generic')[i].innerHTML == 'Ce pseudo vient de quitter la conversation.')
- rageQuits++;
- }
- if(rageQuits > 1) {
- return true;
- }
- }
- return false;
- }
- function surlignerMP(ligne) {
- ligne.find('.c_sup>input').attr('checked', true);
- ligne.find('.sujet>a').css('color', 'red');
- ligne.addClass('select');
- }
- $(document).ready(function(){
- $('.td2b').each(function(){
- $(this).append(' (<a class="scan" href="#">SCAN</a>)');
- });
- $('.scan').each(function(){
- $(this).click(analyserPage);
- });
- });Quic
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement