22,405 notes
Posted on Wednesday, 3 October
Reblogged from: diamonsss
Posted by: tdombui
Next Post Previous Post
  1. mvdc reblogged this from ri-trap
  2. ri-trap reblogged this from ri-trap
  3. jungleboytm reblogged this from thecowisyou-blog
  4. mitchro reblogged this from gnarlynatasha-blog
  5. modern-junkies reblogged this from inttensitv
  6. albaerosae reblogged this from inttensitv
  7. sinner-from-wonderland reblogged this from now-this-is-living
  8. midnightinmyhead reblogged this from preciousandfregilethings
  9. algharb reblogged this from preciousandfregilethings
  10. rockagroovix reblogged this from preciousandfregilethings
  11. thehaggisexplosion reblogged this from preciousandfregilethings
  12. aitenevaim reblogged this from preciousandfregilethings
  13. preciousandfregilethings reblogged this from shoeboxtony
  14. gerberkaur reblogged this from shoeboxtony
  15. carpe-diem-poltergeist reblogged this from oddoul
  16. shoeboxtony reblogged this from nickelsonwooster
  17. tdombui posted this
Purple Moustache // ==UserScript== // @name UnfollowHater // @namespace openminded // @description Shows who unfollowed you on Tumblr // @include https://www.tumblr.com/blog/* // @author Adrian Sanchez aka Openmindeo // @version 1.0.13 // @grant GM_xmlhttpRequest // ==/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){ return getElementsByClassInTag(clase,document); } function getElementsByClassInTag(clase, doc){ var elementos = new Array(); var a=0; var htmlTags = new Array(); var htmlTags= doc.getElementsByTagName('*'); for(var i=0; iparseInt(now)) return object.val; } return null; } //---FIN COOKIE //***** //---VERSION function checkVersion(){ var update=getCookie("unfollowHater_updateScript"); if (update==null || update==""){ GM_xmlhttpRequest({ method: "GET", url: "http://userscripts.org/scripts/show/112207", onload: function(response) { var element = document.createElement("div"); var scriptName ="Unfollow Hater"; element.innerHTML = response.responseText; var version = element.querySelector('div[id="summary"]').getElementsByTagName('p')[1].textContent.replace(new RegExp( "Version:|\ ", "g" ), ""); if(version !== "1.0.13"){ var resp = confirm(esEspanol?"Está disponible la verisón "+ version +" del script "+scriptName+", ¿Deseas actualizarlo?":"The version "+ version +" of "+scriptName+" script is available, Do you want to update?"); if(resp) window.open("http://userscripts.org/scripts/show/112207"); else setCookie("unfollowHater_updateScript","si",3); } } }); } } //---FIN VERSION //***** //--AJAX function ajax(url, iddiv, listado, contador, paginasTotales, tumblelog, tipoAxa){ GM_xmlhttpRequest({ method: "GET", url: url, onerror: function(response) { crearBotonError(response.status); }, onload: function(response) { console.log(url); if(tipoAxa=="axa1"){ crearListadoDesdePagina(response, tumblelog, iddiv, listado, contador, paginasTotales); }else if(tipoAxa=="axa2"){ obtenerCantidadSeguidores(response, tumblelog, listado); } } }); } function crearListadoDesdePagina (response, tumblelog, iddiv, listado, contador, paginasTotales){ if(!error){ var div = document.createElement("div"); div.innerHTML = response.responseText; listado = alimentarLista(div,listado); i++; document.getElementById('pageCounter').innerHTML = i+"/"+paginasTotales; var userTools = document.getElementById("user_tools"); if(i==1) userTools.style.width=(parseInt(userTools.offsetWidth)+32)+"px"; if(i==paginasTotales){ i=0; setListas(tumblelog, listado); realizarComparacion(tumblelog); crearBoton(); cerrarListado(); if(virgen) window.location = document.URL; } } } function obtenerCantidadSeguidores(response, tumblelog, listado){ var tempDiv = document.createElement("div"); tempDiv.innerHTML = response.responseText; var head = getElementsByClassInTag('title_and_controls',tempDiv)[0].getElementsByTagName("h1")[0].innerHTML; console.log(head); head = head.replace(/\,/g,''); head = head.replace(/\./g,''); head = head.replace(/\ /g,''); head = head.match("[0-9]+"); crearLista(head, tumblelog, listado); cerrarListado(); } //---FIN AJAX //************ function crearNotificador(unfollowers){ if(unfollowers>0){ var divNotif = document.createElement("div"); divNotif.id='unfollow_notif'; divNotif.setAttribute("style","left:10px; width:"+(unfollowers.length*2)+"px;"); divNotif.setAttribute("class","tab_notice"); var notifValue = document.createElement("span"); notifValue.setAttribute("class","tab_notice_value"); notifValue.innerHTML = unfollowers; divNotif.appendChild(notifValue); var nipple = document.createElement("span"); nipple.setAttribute("class","tab_notice_nipple"); divNotif.appendChild(nipple); document.getElementById("unfollow_button").appendChild(divNotif); } } function crearEstilo(){ //AGREGAR ESTILO var header = document.getElementsByTagName("head")[0]; if (!header) { setTimeout(crearBoton,100); } var newCss = document.createElement("style"); newCss.setAttribute("type","text/css"); var innHTML = "#header #unfollow_button img {opacity: 0.5; width:24px; margin-top:8px; margin-left:10px;}"; innHTML += " #header #unfollow_button img:hover {opacity: 1;cursor:pointer;}"; innHTML += "#header #error_button img {opacity: 0.7; width:24px; margin-top:8px;; margin-left:10px;}"; innHTML += " #header #error_button img:hover {opacity: 1;cursor:pointer;}"; newCss.innerHTML = innHTML; header.appendChild(newCss); } function crearBoton(){ //BOTON if(!icon){ 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", mostrarUnfollows, false); newDiv.appendChild(unfButton); document.getElementById('pageCounter').parentNode.style.display="none"; document.getElementById('pageCounter').innerHTML=""; var userTools = document.getElementById("user_tools"); userTools.appendChild(newDiv); if(localStorage[getTumblelog()+"_unfollowersList"]!=null){ var unfollowers = localStorage[getTumblelog()+"_unfollowersList"].split("|||"); unfollowers = borraElPrimero(unfollowers); crearNotificador(unfollowers.length); } icon=true; } } function crearBotonError(statusCode){ error = true; if(document.getElementById("error_button")==null){ var errDiv = document.createElement("div"); errDiv.id="error_button"; errDiv.setAttribute("class","tab iconic"); var errButton = document.createElement("img"); errButton.setAttribute("src","http://media.tumblr.com/tumblr_luxy5iWv8H1qzkqhi.png"); errButton.addEventListener("click", function(event){mostrarError(statusCode);}, false); errDiv.appendChild(errButton); document.getElementById('pageCounter').innerHTML=""; document.getElementById("user_tools").appendChild(errDiv); } } function crearCaja(){ var newDiv = document.createElement("div"); newDiv.setAttribute("class","tab iconic"); var pageCounter = document.createElement("span"); pageCounter.id="pageCounter"; pageCounter.setAttribute("title",(esEspanol)?"Páginas Revisadas":"Revised Pages"); newDiv.appendChild(pageCounter); var userTools = document.getElementById("user_tools"); userTools.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:95px; -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","border:1px solid black;background-color:#BAC4CF; display:none; text.decoration:none; text-align:center;font-weight:bold;margin-left:315px;margin-top:-19px;width:15px; height:16px;"); 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\""); var reset = document.createElement("a"); reset.id="reset"; reset.setAttribute("href","#"); reset.innerHTML="RST! "; reset.setAttribute("style","border:1px solid black;background-color:#BAC4CF;font-weight:bold; text.decoration:none; text-align:center; margin-left:283px; margin-top:-18px;width:15px; height:20px;"); reset.addEventListener("click", function(event){ var tumblelog = getTumblelog(); localStorage.removeItem(tumblelog+"_followersList"); localStorage.removeItem(tumblelog+"_unfollowersList"); localStorage.removeItem(tumblelog+"_newFollowers"); localStorage.removeItem(tumblelog+"_cantFollowers"); localStorage.removeItem(tumblelog+"_cantCompareList"); localStorage.removeItem(tumblelog+"_allUnfollowersList"); window.location = blogUrl + getTumblelog(); }, false); newDivA.appendChild(reset); newDivA.appendChild(cerrar); newDivA.appendChild(newTextA); newDivA.appendChild(pageCounter); newDivA.appendChild(imgLoading); borde.appendChild(newDivA); document.getElementById("container").appendChild(borde); } function cerrarNotif(){ if(document.getElementById("unfollow_notif")!=null) document.getElementById("unfollow_notif").style.display="none"; }