Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Quién te elimina de Tuenti

Acabado, debería funcionar.
  • Loading branch information...
commit e92e5437ed43ed41d800025e16627f7de433cc84 1 parent d0fbc9a
Jesús authored
View
52 extension/js/background.js
@@ -90,15 +90,14 @@ if (localStorage.time_getNews) {
setInterval(function(){getNews()}, t_int) //CAMBIARLO MÁS TARDE
-/*Saber quién te ha borrado de Tuenti*/
+/*Saber quién te ha borrado de Tuenti*/ //DEBES ESTAR CONECTADO A TUENTI MÓVIL
-var friendsArray = []
-var conexion
-var number = 0
-var deletedFriends
-var numberDeletedFriends = 0
+var friendsArray = [] //Array con tus amigos en Tuenti
+var conexion //Objeto XMLHttpRequest
+var number = 0 //Página actual
+var deletedFriends //Amigos que te han borrado
-function getFriends() {
+function getFriends() { //Se llama recursivamente a http://m.tuenti.com/?m=Friends&page= para obtener una lista de todos tus amigos
conexion = new XMLHttpRequest();
conexion.onreadystatechange = processFriends;
conexion.open('GET', 'http://m.tuenti.com/?m=Friends&page=' + number, true);
@@ -119,28 +118,33 @@ function processFriends() {
getFriends()
}
else{
- friendsArray2 = []
- if(localStorage["tuentiFriendsArray"]!=undefined){
- friendsArray2 = JSON.parse(localStorage["tuentiFriendsArray"])
- }
- deletedFriends = []
- for(d=0;d<friendsArray2.length;d++){
- var finded = false
- for(e=0;e<friendsArray.length;e++){
- if(friendsArray2[d][0]==friendsArray[e][0]&&friendsArray2[d][1]==friendsArray[e][1]){finded=true}
+ if(friendsArray.length>0){
+ friendsArray2 = []
+ if(localStorage["tuentiFriendsArray"]!=undefined){
+ friendsArray2 = JSON.parse(localStorage["tuentiFriendsArray"])
}
- if(finded==false){
- deletedFriends[deletedFriends.length]=friendsArray2[d]
+ deletedFriends = []
+ for(d=0;d<friendsArray2.length;d++){
+ var finded = false
+ for(e=0;e<friendsArray.length;e++){
+ if(friendsArray2[d][0]==friendsArray[e][0]&&friendsArray2[d][1]==friendsArray[e][1]){finded=true}
+ }
+ if(finded==false){
+ deletedFriends[deletedFriends.length]=friendsArray2[d]
+ }
}
+ localStorage["tuentiFriendsArray"]=JSON.stringify(friendsArray)
+ numberDeletedFriends=deletedFriends.length
+ localStorage["tuentiDeletedFriends"]=JSON.stringify(deletedFriends)
}
- localStorage["tuentiFriendsArray"]=JSON.stringify(friendsArray)
- localStorage["tuentiDeletedFriends"]=JSON.stringify(deletedFriends)
}
}
}
-var a = new Date()
-if(a.getMonth()+"-"+a.getDate()+"-"+a.getHours()!=localStorage["tuentiLastFriendsGet"]){
- localStorage["tuentiLastFriendsGet"]=a.getMonth()+"-"+a.getDate()+"-"+a.getHours()
- getFriends()
+if(JSON.parse(localStorage.mods_activos).tuenti && localStorage["tuenti_deleted_friends_notifications"]=="true"){
+ var a = new Date()
+ if(a.getMonth()+"-"+a.getDate()+"-"+a.getHours()!=localStorage["tuentiLastFriendsGet"]){ //Esto hace que cuando se inicio chrome, si ha pasado más de una hora desde la última vez que lo abriste, revise si alguien te ha eliminado de Tuenti.
+ localStorage["tuentiLastFriendsGet"]=a.getMonth()+"-"+a.getDate()+"-"+a.getHours()
+ setTimeout("getFriends()",5000)
+ }
}
View
7 extension/js/popup.js
@@ -1,4 +1,11 @@
window.onload = function cargaModulos() {
+
+ tuentiDeleted = JSON.parse(localStorage["tuentiDeletedFriends"])//Mostramos quién te ha borrado en Tuenti
+ for(d=0;d<tuentiDeleted.length;d++){
+ document.getElementById("tuentiDeleted").innerHTML+='<a href="http://www.tuenti.com/#m=Profile&func=index&user_id='+tuentiDeleted[d][1]+'"><b>'+tuentiDeleted[d][0]+'</b> te ha eliminado de Tuenti</a>'
+ }
+ localStorage["tuentiDeletedFriends"]="[]" //Reseteamos las notificaciones de gente que te ha borrado en Tuenti
+
var a = document.getElementsByClassName('section')
for (i = 0; i < a.length; i++) {
a[i].style.display = "none"
View
8 extension/popup.html
@@ -101,9 +101,7 @@
</style>
<script type="text/javascript" src="js/popup.js"></script>
-<script type="text/javascript">
-localStorage["tuentiDeletedFriends"]="[]" //Reseteamos las notificaciones de gente que te ha borrado en Tuenti
-</script>
+
</head>
@@ -148,5 +146,9 @@
<div class="nots">0</div>
</div>
</div>
+ <!--Gente que te ha eliminado de Tuenti-->
+ <div id="tuentiDeleted">
+
+ </div>
</body>
</html>
Please sign in to comment.
Something went wrong with that request. Please try again.