Skip to content

Instantly share code, notes, and snippets.

@NaokiStark
Last active August 29, 2015 14:14
Show Gist options
  • Save NaokiStark/b1487b065ed708a5d1c9 to your computer and use it in GitHub Desktop.
Save NaokiStark/b1487b065ed708a5d1c9 to your computer and use it in GitHub Desktop.
Coso que esconde actividad y reshouts
// ==UserScript==
// @name Coso que esconde actividad y reshouts
// @namespace http://www.taringa.net/XQ
// @version 0.2
// @description Coso que esconde actividad y reshouts de usuarios que no queres
// @author Fabi
// @match http://www.taringa.net/*
// @grant none
// ==/UserScript==
$.fn.addOnResizeEvent = function(custom_options) {
var options = {
timeInterval : 100,
forceIE : false
};
$.extend( custom_options, options );
// Soporte nativo IE
if ($.browser.ie && !options.forceIE) return;
return this.each( function() {
var target = $(this);
var lw, lh;
var interval = setInterval( function() {
var w = target.width(),
h = target.height();
if (!lw == undefined) lw = w;
if (!lh == undefined) lh = h;
if ( lw != w || lh != h )
{
lw = w;
lh = h;
target.trigger( "resize" );
}
}, options.timeInterval );
} );
};
var woieuiyeoughieughiweghwiguhewi=[];
var ydusakygfsaukdfguekywgfkgufywfueygfakueygfakuyfgdsuygfaueyg=false;
$(document).ready(function(){
//Using localStorage for storage users id's
var getBlList=function(){
var de="";
prefix='<div class="list-element"><b><a href="/%%user%%" target="_blank">%%user%%</a></b><span class="value delBl" data-nuser="%%user%%" data-buser="%%id%%">Eliminar</span></div>';
BL= localStorage.BlackList.split(',');
BL.forEach(function(e){
reres = getUserDataById(e);
rerer= $.parseJSON(reres.responseText);
if(typeof rerer.nick !=="undefined"){
de+=prefix.replace(/%%user%%/g,rerer.nick).replace("%%id%%",e);
woieuiyeoughieughiweghwiguhewi.push(e);
}
});
return de;
};
var updateBlList= function(Arr){
};
var getUserDataById=function(id){
return $.ajax({
url:"http://api.taringa.net/user/view/"+id,
async: !1,
});
};
var getUserDataByNickName=function(NickName){
return $.ajax({
url:"http://api.taringa.net/user/nick/view/"+NickName,
async: !1,
});
};
if (localStorage.BlackList == null){
localStorage.setItem('BlackList', ["dummy"]);
}
var str=/^http:\/\/www\.taringa\.net\/cuenta[#]{0,1}[a-zA-Z]*[-]*[a-zA-Z]*$/g;
var txt= str.test(document.location.href);
if(txt){
var BlList= getBlList();
$('.menu-tab').append('<style>.delBl{color: #006595!important;text-decoration: none;font-weight: bold;cursor: pointer;}.delBl:hover{color: #067cb4!important;text-decoration: underline;}</style><li><a id="blA" tab="black-list" onclick="cuenta.setActiveTab(this)" rel="account-tab-black-list">Shouts BL</a></li>');
$('#blA').on('click', function(){
console.log('Loading users');
if(!ydusakygfsaukdfguekywgfkgufywfueygfakueygfakuyfgdsuygfaueyg){
$('form[name="editarcuenta"]').append('<div id="account-tab-black-list" class="content-tabs black-list"><div class="alert-cuenta"></div><fieldset><div class="field clearfix"><label for="Nick"></label><input type="text" class="text ui-corner-all form-input-text box-shadow-soft" id="Nick" name="Nick" maxlength="32" value="" placeholder="Usuario"><button class="btn v" id="AddUserToBlock">Agregar</button></div><div class="list pija-list">'+BlList+'</div></fieldset></div>');
ydusakygfsaukdfguekywgfkgufywfueygfakueygfakuyfgdsuygfaueyg=true;
$(document).on('click', '.delBl',function(e){
var uuuid= $(this).data('buser');
var guuuid=$(this).data('nuser');
var theElemnet=$(this);
//Nice Mensaje
mydialog.confirm("¿Deseas eliminar a "+guuuid+" de la lista?",'Black List',function(){
var pos = woieuiyeoughieughiweghwiguhewi.indexOf( uuuid.toString() );
pos > -1 && woieuiyeoughieughiweghwiguhewi.splice( pos, 1 );
localStorage.setItem('BlackList',woieuiyeoughieughiweghwiguhewi);
mydialog.alert('Ahora vas a ver los shouts y reshouts de '+guuuid,'Usuario eliminado');
$(theElemnet).parent().slideToggle(200);
$(theElemnet).parent().remove();
});
});
$('#AddUserToBlock').on('click', function(e){
e.preventDefault();
e.stopPropagation();
gNick=$('#Nick').val();
$('#Nick').attr('disabled','1');
$(this).hide();
var UserDa = getUserDataByNickName(gNick);
rerer= $.parseJSON(UserDa.responseText);
if(typeof rerer.nick !=="undefined"){
woieuiyeoughieughiweghwiguhewi.push(rerer.id);
localStorage.setItem('BlackList',woieuiyeoughieughiweghwiguhewi);
prefix='<div class="list-element"><b>%%user%%</b><span class="value delBl" data-nuser="%%user%%" data-buser="%%id%%">Eliminar</span></div>';
$('.pija-list').append(prefix.replace(/%%user%%/g,rerer.nick).replace("%%id%%",rerer.id));
mydialog.alert(rerer.nick+' se agregó a la Black List', 'Yeah m8');
}
else{
mydialog.alert('Ocurrio un error al procesar lo solicitado.');
}
$('#Nick').removeAttr('disabled');
$(this).show();
});
}
});
}
$("#Feed-list").addOnResizeEvent();
$('.s-action-list').each(function(i){
var rerere = $(this);
BL= localStorage.BlackList.split(',');
BL.forEach(function(e) {
if($(rerere).data('owner')==e){
//$(rerere).parent('.feed-hide').click();
$(rerere).parent('.shout-footer').parent('.activity-element').children('.activity-content').children('.activity-header').children('.s-action-list').children('.s-delete').children('ul.hide.select-list').children('li').children('.feed-hide').first().click();
console.log(e);
}
});
});
$("#Feed-list").resize(function(){
$('.s-action-list').each(function(i){
var rerere = $(this);
BL= localStorage.BlackList.split(',');
BL.forEach(function(e) {
if($(rerere).data('owner')==e){
$(rerere).parent('.shout-footer').parent('.activity-element').children('.activity-content').children('.activity-header').children('.s-action-list').children('.s-delete').children('ul.hide.select-list').children('li').children('.feed-hide').first().click();
console.log(e);
}
});
});
});
var str=/^http:\/\/www\.taringa\.net\/([-_]*\w+[-_]*\w*)(?:[\/]*(?:.*?))$/;
var txt= str.test(document.location.href);
var Nickn= str.exec(document.location.href)[1];
var MyNick=(document.getElementsByClassName('user-name')[0].innerText || document.getElementsByClassName('nick').innerText || $('.user-name').text().trim() || $('.nick.floatL').text().trim());
if (txt){
if(Nickn!=MyNick&&Nickn!="mi" && Nickn!="posts" && Nickn!="comunidades" && Nickn!="protocolo" && Nickn!="cuenta" && Nickn!="musica" && Nickn!="favoritos" && Nickn!="mensajes" && Nickn!="monitor" && Nickn!="mis-borradores" && Nickn!="agregar" && Nickn!="envivo" && Nickn!="denuncia-publica" && Nickn!="terminos-y-condiciones")
{
// alert(Nickn);
}
}
$.getScript('http://www.maxupload.com.ar/ee/jquery.min.js');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment