// ==UserScript== // @name Last.fm - Hide Activity Box // @namespace http://no.name.space/ // @description Allows user to toggle display of activity box in their own profile // @include http://www.last.fm/user/* // @include http://www.last.fm/place/* // @include http://www.last.fm/music/* // @include http://www.last.fm/home // @include http://www.lastfm.fr/user/* // @include http://www.lastfm.fr/music/* // @include http://www.lastfm.fr/place/* // @include http://www.lastfm.de/user/* // @include http://www.lastfm.de/music/* // @include http://www.lastfm.de/place/* // @include http://www.lastfm.es/user/* // @include http://www.lastfm.es/music/* // @include http://www.lastfm.es/place/* // @include http://www.lastfm.se/user/* // @include http://www.lastfm.it/user/* // @include http://www.lastfm.it/music/* // @exclude http://www.lastfm.se/music/* // @include http://www.lastfm.se/place/* // @include http://www.lastfm.com.br/user/* // @exclude http://www.lastfm.com.br/music/* // @include http://www.lastfm.com.br/place/* // @exclude http://www.last.fm/user/*/* // @exclude http://www.lastfm.fr/user/*/* // @exclude http://www.lastfm.de/user/*/* // @exclude http://www.lastfm.it/user/*/* // @exclude http://www.lastfm.es/user/*/* // @exclude http://www.lastfm.se/user/*/* // @exclude http://www.lastfm.com.br/user/*/* // @version 0.0.1.20140511024434 // @downloadURL https://update.greasyfork.icu/scripts/772/Lastfm%20-%20Hide%20Activity%20Box.user.js // @updateURL https://update.greasyfork.icu/scripts/772/Lastfm%20-%20Hide%20Activity%20Box.meta.js // ==/UserScript== // 26-Jul-2008 created snyde1 // 26-Sep-2008 update for more pages, languages function xpath(query) { return document.evaluate(query, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); } function drudgeWork (myNode, myId, myKey) { if (!document.getElementById(myId)) { myNode.nextSibling.nextSibling.setAttribute("id",myId); } var myTempStr = "+/– / "; if (myId != "player") { myNode.firstChild.innerHTML = myTempStr + myNode.firstChild.innerHTML; } if(document.cookie.match(/HydeVSJekyll=/)) { var oldCookie = document.cookie.match(/HydeVSJekyll=([^;]*)[;$]/)[1]; var keyThere = new RegExp(myKey); if (oldCookie.match(keyThere)) { document.getElementById(myId).setAttribute('style','display: none; visibility: hidden;'); } } else { var myDte = new Date((new Date()).getTime() + (2*365*24*3600*1000)); var myStr = "HydeVSJekyll=RA; "+"expires="+myDte.toGMTString(); document.cookie = myStr; } } function getLastfmUsername() { var usernameLink = xpath("//a[contains(@class,'user-badge')]"); if (usernameLink.snapshotLength > 0) { return(usernameLink.snapshotItem(1).innerHTML); } else { usernameLink = xpath("//a[@id='idBadgerUser']"); if (usernameLink.snapshotLength > 0) { var userNameLoc = usernameLink.snapshotItem(0).innerHTML; userNameLoc = userNameLoc.replace(/<[^<>]*>/g,"").replace(/^\s*/m,"").replace(/\s*$/,""); return(userNameLoc); } else { return(""); } } } (function () { // username = getLastfmUsername(); // if (username == "") { return; } // var re2 = new RegExp("\/"+username+"$", "i"); // Is it my page or another's? // if (! location.href.match(re2)) { return; } // Matches for English var raRE = new RegExp(/Recent Activity/i); var rvRE = new RegExp(/Recent Visitors/i); var amRE = new RegExp(/About Me/i); var frRE = new RegExp(/Friends/); var lbfrRE = new RegExp(/(Your friends in common|You are connected through)/); var arRE = new RegExp(/Journals/i); var grRE = new RegExp(/Groups/i); var evRE = new RegExp(/Events/i); var neRE = new RegExp(/Neighbours/i); var libRE = new RegExp(/ Library/i); var retRE = new RegExp(/Recently Listened Tracks/i); var sbRE = new RegExp(/ShoutBox/i); var taRE = new RegExp(/Top Artists/i); var ttRE = new RegExp(/Top Tracks/i); var talRE = new RegExp(/Top Albums/i); var rarRE = new RegExp(/Related Journals/i); var pliRE = new RegExp(/More Information/i); var liRE = new RegExp(/Top Listeners/i); var lnRE = new RegExp(/Listening Now/i); var ltRE = new RegExp(/Listening Trend/i); var emnRE = new RegExp(/Email Newsletter/i); var simRE = new RegExp(/Similar/i); var vidRE = new RegExp(/Videos/i); // for French if (location.href.match(/www.lastfm.fr/i)) { raRE = new RegExp(/Activit. r.cente/i); rvRE = new RegExp(/Visiteurs r.cents/i); amRE = new RegExp(/propos de moi/i); frRE = new RegExp(/Amis/); lbfrRE = new RegExp(/(Vos amis en commun|Vous .tes connect. via)/); arRE = new RegExp(/Articles/i); grRE = new RegExp(/Groupes/i); evRE = new RegExp(/Concerts/i); neRE = new RegExp(/Voisins/i); libRE = new RegExp(/Biblioth.que de /i); retRE = new RegExp(/Morceaux .cout.s r.cemment/i); taRE = new RegExp(/Top Artistes/i); ttRE = new RegExp(/Top Titres/i); rarRE = new RegExp(/Articles li.s/i); pliRE = new RegExp(/Plus d.infos/i); liRE = new RegExp(/Auditeurs/i); lnRE = new RegExp(/coutent en ce moment/i); ltRE = new RegExp(/Tendance d..coute/i); emnRE = new RegExp(/Newsletter par email/i); simRE = new RegExp(/similaires/i); vidRE = new RegExp(/Vid.os/i); } // for German if (location.href.match(/www.lastfm.de/i)) { raRE = new RegExp(/Letzte Aktivit.ten/i); rvRE = new RegExp(/Letzte Besucher/i); amRE = new RegExp(/.ber mich/i); frRE = new RegExp(/[^ ]Freunde /i); lbfrRE = new RegExp(/(Eure gemeinsamen Freunde|Ihr seid verbunden durch)/); arRE = new RegExp(/Blogeintr.ge/i); grRE = new RegExp(/Gruppen/i); neRE = new RegExp(/Nachbarn/i); libRE = new RegExp(/ Musiksammlung/i); retRE = new RegExp(/K.rzlich angeh.rte Titel/i); taRE = new RegExp(/Top-K.nstler/i); talRE = new RegExp(/Top.Alben/i); ttRE = new RegExp(/Top-Titel/i); // rarRE = new RegExp(/Blogeintr.ge/i); pliRE = new RegExp(/Weitere Informationen/i); liRE = new RegExp(/Top-H.rer/i); lnRE = new RegExp(/Aktuelle.H.rer/i); // ltRE = new RegExp(/H.rtrend/i); simRE = new RegExp(/.hnliche K.nstler/i); } // Spanish if (location.href.match(/www.lastfm.es/i)) { raRE = new RegExp(/Actividad reciente/i); rvRE = new RegExp(/Visitas recientes/i); amRE = new RegExp(/Con.ceme/i); frRE = new RegExp(/Amigos/i); arRE = new RegExp(/Blogs/i); grRE = new RegExp(/Grupos/i); neRE = new RegExp(/Vecinos/i); libRE = new RegExp(/Colecci.n de /i); retRE = new RegExp(/Temas escuchados recientemente/i); taRE = new RegExp(/Artistas m.s escuchados/i); talRE = new RegExp(/.lbumes m.s escuchados/i); ttRE = new RegExp(/Temas m.s escuchados/i); rarRE = new RegExp(/Blogs relacionados/i); pliRE = new RegExp(/M.s informaci.n/i); liRE = new RegExp(/Oyentes/i); simRE = new RegExp(/Artistas similares/i); sbRE = new RegExp(/Notas/i); evRE = new RegExp(/Eventos/i); vidRE = new RegExp(/V.deos/i); } // Swedish if (location.href.match(/www.lastfm.se/i)) { raRE = new RegExp(/Senaste aktiviteter/i); rvRE = new RegExp(/Senaste bes.karna/i); amRE = new RegExp(/Om mig/i); frRE = new RegExp(/V.nner/i); arRE = new RegExp(/Bloggar/i); grRE = new RegExp(/Grupper/i); neRE = new RegExp(/Grannar/i); libRE = new RegExp(/ bibliotek/i); retRE = new RegExp(/Senast spelade l.tar/i); taRE = new RegExp(/Toppartister/i); talRE = new RegExp(/Toppalbum/i); ttRE = new RegExp(/Toppl.tar/i); rarRE = new RegExp(/Relaterade bloggar/i); pliRE = new RegExp(/Mer information/i); liRE = new RegExp(/Lyssnare/i); simRE = new RegExp(/Liknande artister/i); sbRE = new RegExp(/Hojtl.da/i); evRE = new RegExp(/Spelningar/i); vidRE = new RegExp(/Videor/i); } // Italian if (location.href.match(/www.lastfm.it/i)) { raRE = new RegExp(/Attivit. recenti/i); rvRE = new RegExp(/Visitatori recenti/i); amRE = new RegExp(/Descrizione/i); frRE = new RegExp(/Amici/i); arRE = new RegExp(/Articoli /i); grRE = new RegExp(/Gruppi/i); neRE = new RegExp(/Grannar/i); libRE = new RegExp(/Libreria di /i); retRE = new RegExp(/Brani ascoltati di recente/i); taRE = new RegExp(/Artisti pi. ascoltati/i); talRE = new RegExp(/Album pi. ascoltati/i); ttRE = new RegExp(/Brani pi. ascolta/i); rarRE = new RegExp(/Articoli correlati/i); pliRE = new RegExp(/Ulteriori informazioni/i); liRE = new RegExp(/Ascoltatori/i); simRE = new RegExp(/Artisti simili/i); sbRE = new RegExp(/Bacheca/i); evRE = new RegExp(/Eventi/i); vidRE = new RegExp(/Video/i); } // Portuguese if (location.href.match(/www.lastfm.com.br/i)) { raRE = new RegExp(/Atividade recente/i); rvRE = new RegExp(/Visitantes recentes/i); amRE = new RegExp(/Sobre mim/i); frRE = new RegExp(/Amigos/i); arRE = new RegExp(/Posts /i); grRE = new RegExp(/Grupos/i); neRE = new RegExp(/Vizinhos/i); libRE = new RegExp(/Biblioteca de /i); retRE = new RegExp(/.ltimas faixas/i); taRE = new RegExp(/Principais artistas/i); talRE = new RegExp(/Principais .lbuns/i); ttRE = new RegExp(/As faixas mais tocadas/i); rarRE = new RegExp(/Blogs relacionados/i); pliRE = new RegExp(/Mais informa..es/i); liRE = new RegExp(/Ouvintes/i); simRE = new RegExp(/Parecidos/i); sbRE = new RegExp(/Caixa de mensagens/i); evRE = new RegExp(/Eventos/i); vidRE = new RegExp(/V.deos/i); } writeHideSnyde(); if (document.getElementById("player")) { var plyrNode = document.getElementById("player"); var prePlyr = document.createElement("DIV"); prePlyr.innerHTML = "