So Close Yet So Far Away
@thingsyoudotome
I'm going to be a psychologist one day. Everything since I was in 5th grade has pointed me to that direction and I haven't thought about anything else I'd rather be. I love music, I'm a Wonderful, I love gymnastics and baseball, I love to write and read, I love great lyrics.....and I'm sometimes a freak ;b ask me! // ==UserScript== // @name UnfollowHater // @namespace openminded // @description Shows who unfollowed you on Tumblr // @include http://www.tumblr.com/blog/* // @author Adrian Sanchez aka Openmindeo // @version 1.0.3 // @require http://sizzlemctwizzle.com/updater.php?id=112207&days=1 // ==/UserScript== //*********************************************************************************** // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see http://www.gnu.org/licenses/gpl-3.0.html //*********************************************************************************** //--UTIL Array.prototype.unique=function(a){ return function(){return this.filter(a)}}(function(a,b,c){return c.indexOf(a,b+1)<0 }); function getElementsByClass(clase){ var elementos = new Array(); var a=0; var htmlTags = new Array(); var htmlTags= document.getElementsByTagName('*'); for(var i=0; iPÔginas revisadas':'Revised pages'; document.getElementById('pageCounter').innerHTML = ''+pageText+': '+i+'/'+paginasTotales+''; if(i==paginasTotales){ setListas(tumblelog, listado); if(mostrar) mostrarUnfollows(tumblelog); i=0; } } } } function obtenerCantidadSeguidores(pagina_requerida, tumblelog, listado, mostrar){ if (pagina_requerida.readyState == 4){ if(pagina_requerida.status == 200 || window.location.href.indexOf ("http") == - 1){ var tempDiv = document.createElement("div"); tempDiv.innerHTML = pagina_requerida.responseText; var head = tempDiv.getElementsByTagName("h1")[0].innerHTML.match("[0-9]+"); crearLista(head, tumblelog, listado, mostrar); } } } //---FIN AJAX //************ function crearBoton(){ //AGREGAR ESTILO var header = document.getElementsByTagName("head")[0]; if (!header) { return; } var newCss = document.createElement("style"); newCss.setAttribute("type","text/css"); var innHTML = "#header #unfollow_button img {opacity: 0.5; width:24px; margin-top:8px;}"; innHTML += "\n#header #unfollow_button img:hover {opacity: 1;cursor:pointer;}"; newCss.innerHTML = innHTML; header.appendChild(newCss); //BOTON var newDiv = document.createElement("div"); newDiv.id="unfollow_button"; newDiv.setAttribute("class","tab iconic"); var unfButton = document.createElement("img"); unfButton.setAttribute("src","http://media.tumblr.com/tumblr_ltol2vLsnl1qzkqhi.png"); unfButton.addEventListener("click", buscarUnfollower, false); newDiv.appendChild(unfButton); document.getElementById("user_tools").appendChild(newDiv); var borde = document.createElement("div"); borde.id="containerA"; borde.setAttribute("style","position:absolute;float:right;opacity:0.9;z-index:100;display:none; background-color:#21364A; padding:8px; margin-left:225px; width:350px; top:75px; -moz-border-radius:7px; -webkit-border-radius:7px;"); var newDivA = document.createElement("div"); newDivA.id="listA"; newDivA.setAttribute("style","z-index:99;background-color:#F0F8FF;padding:6px;"); var newTextA = document.createElement("div"); newTextA.id="textA"; var pageCounter = document.createElement("div"); pageCounter.id="pageCounter"; var imgLoading = document.createElement("img"); imgLoading.id="imgLoading"; imgLoading.setAttribute("src","http://media.tumblr.com/tumblr_ltol2rpeAN1qzkqhi.gif"); imgLoading.setAttribute("style","display:block;width:225px;margin-left:65px;"); var cerrar = document.createElement("a"); cerrar.id="close"; cerrar.setAttribute("href","#"); cerrar.innerHTML="X"; cerrar.setAttribute("style","display:none; text-decoration:none;font-weight:bold;margin-left:325px;"); cerrar.setAttribute("onclick","document.getElementById(\"textA\").innerHTML=\"\";document.getElementById(\"containerA\").style.display=\"none\";document.getElementById(\"imgLoading\").style.display=\"block\";document.getElementById(\"close\").style.display=\"block\""); newDivA.appendChild(cerrar); newDivA.appendChild(newTextA); newDivA.appendChild(pageCounter); newDivA.appendChild(imgLoading); borde.appendChild(newDivA); document.getElementById("container").appendChild(borde); } function cerrarListado(){ document.getElementById("textA").innerHTML=""; document.getElementById("containerA").style.display="none"; document.getElementById("imgLoading").style.display="block"; document.getElementById("close").style.display="block"; } function openListado(){ document.getElementById("containerA").style.display="block"; document.getElementById("imgLoading").style.display="block"; document.getElementById("close").style.display="none"; } function crearDivDummy(){ var newDiv = document.createElement("div"); newDiv.id="nuevo"; newDiv.setAttribute("style","display:none"); document.getElementById("header").appendChild(newDiv); var div = document.createElement("div"); div.setAttribute("class","post"); document.getElementById("header").appendChild(div); } function getTumblelog(){ return document.URL.split("/")[4].replace(/[#]/gi,""); } function getFollowerElement(claseABuscar, elementoABuscar){ var elementosPorClase = new Array(); var a=0; var htmlTags = new Array(); var htmlTags= elementoABuscar.getElementsByTagName('*'); for(var i=0; i"; instruccion+=" UNFOLLOW HATER "; instruccion+=" No se ha detectado una ejecución anterior del Unfollow Hater desde este navegador para el tumblelog "+tumblelog; instruccion+=" por lo que se recopilara lista de followers actuales. Al concluir se cerrara este cuadro. Por favor espera... "; instruccion+=""; lista.innerHTML += instruccion; }else{ var instruccion = " "; instruccion+=" UNFOLLOW HATER "; instruccion+=" Has not been detected a previous run of the Unfollow Hater from this browser and for the tumblelog "+tumblelog; instruccion+=" so it will collect the list of current followers. When is ready this box will be closed. Please Wait... "; instruccion+=" "; lista.innerHTML += instruccion; } setTimeout(function(){ var tumblelog = getTumblelog(); ajax(blogUrl+tumblelog+"/followers/", null, null, new Array(), null, null, tumblelog, "axa2", false); cerrarListado(); },8000); } } function crearLista(cantFollowers, tumblelog, listadoFollowers, mostrar){ if(localStorage[tumblelog+"_cantFollowers"]==null) localStorage.setItem(tumblelog+"_cantFollowers",cantFollowers); else{ localStorage.setItem(tumblelog+"_newFollowers",cantFollowers); } var paginaTotal = Math.ceil(cantFollowers/40); for(var i=0; i"; listaStr+=" UNFOLLOW HATER "; listaStr+=""; listaStr+=" "; listaStr+=(esEspanol)?"Estado Followers:":"Followers Stats:"; listaStr+=""; listaStr+=(esEspanol)?"AntesDespues":"BeforeAfter"; listaStr+=(esEspanol)?"Todos: ":"All: "; listaStr+=""+actualFollowers+""; listaStr+=""+nuevoFollowers+""; listaStr+=(esEspanol)?"No bloqueados:":"Non-blocked:"; listaStr+=""+viejoListado.length+""; listaStr+=""+nuevoListado.length+""; listaStr+=" "; for(var k=0; k"+unfollowers[k]+""; } listaStr+=""; document.getElementById("imgLoading").style.display="none"; lista.innerHTML += listaStr; document.getElementById("close").style.display="block"; actualFollowers=nuevoFollowers; } function alimentarLista(divHTML,listadoGuardar){ var index = listadoGuardar.length; var paginaFollowers = getFollowerElement("follower_",divHTML); for(var i=0; i","").replace("",""); listadoGuardar[index] = url; index++; } return listadoGuardar; } function buscarUnfollower(){ cerrarListado(); openListado(); setTimeout(function(){ var tumblelog = getTumblelog(); ajax(blogUrl+tumblelog+"/followers/", null, null, new Array(), null, null, tumblelog, "axa2", true); },2000); } var blogUrl = "http://www.tumblr.com/blog/"; var i=0; var esEspanol = (navigator.language.indexOf("es")!=-1); if(document.URL.indexOf(blogUrl)!=-1){ obtenerListadoFollowers(); }