· 7 years ago · Jan 09, 2019, 07:28 PM
1var mail_name = '24mclvb00'; // CAMBIA 'PON_UN_MAIL_AQUI' POR LO QUE QUIERAS (SIN '@gmail.com')
2var attemps = 2000;
3
4function repeat() {
5 var repeat_time = Math.floor((Math.random() * 2000) + 2000);
6
7 console.log('%c ##### Siguiente intento en ' + repeat_time + ' milisegundos ', 'background-color: grey; color: white;');
8
9 setTimeout(init, repeat_time);
10}
11
12function play(mail, callback) {
13 $.ajax({
14 contentType: 'application/json',
15 crossDomain: true,
16 data: JSON.stringify({email: mail}),
17 dataType: 'json',
18 type: 'POST',
19 url: 'https://www.ganasdetelepizza.es//check-prize',
20
21 success: function (result) {
22 var response = JSON.parse(JSON.stringify(JSON.parse(result['body'])));
23
24 callback(response.responseMessage);
25 }
26 });
27}
28
29function validate(mail, callback) {
30 $.ajax({
31 contentType: 'application/json',
32 crossDomain: true,
33 data: JSON.stringify({email: mail, receive_offert: true}),
34 dataType: 'json',
35 type: 'POST',
36 url: 'https://www.ganasdetelepizza.es//check-mail',
37
38 success: function(result) {
39 var response = JSON.parse(JSON.stringify(JSON.parse(result['body'])));
40
41 callback(response.responseMessage);
42 }
43 });
44}
45
46function init() {
47 var mail = mail_name + attemps + '@gmail.com';
48
49 console.log('%c # Intento ' + attemps++ + ' con mail ' + mail + ' ', 'background-color: blue; color: white;');
50
51 validate(mail, function(response) {
52 if(response == 'EMAIL_SAVED') {
53 play(mail, function(response) {
54 console.log(response);
55 if(response == 'USER_IS_WINNER') {
56 console.log('%c ########## HAS GANADO %c (mail: ' + mail + ') ', 'background-color: green; color: white; font-size: 16px; font-weight: bold', 'background-color: white; color: green;font-size: 16px; font-size: 11px; font-weight: bold;');
57 }
58 else {
59 console.log('%c ### No has ganado (' + response + ') ', 'background-color: red; color: white; font-weight: bold;');
60
61 repeat();
62 }
63 });
64 }
65 else {
66 console.log('%c ### No has ganado (' + response + ') ', 'background-color: red; color: white; font-weight: bold;');
67
68 repeat();
69 }
70 });
71}
72
73init();