· 7 years ago · Jan 09, 2019, 03:06 PM
1//ZONA SEGURA, PUEDEN JUGAR AQUI
2var domain = "gmail.com"
3var correo = "example" //Aquà tu nombre para el correo
4
5//SI NO ENTIENDES NI PAPA, ATRAS!!!!!
6var time_check = 10000 //No lo bajes o quedas ban
7var time_pizzas = 60000 //Tampoco lo bajes
8var timeout_telewin = 0;
9var timeout_telequeda = 0;
10var counter = 10;
11
12function telewin(){
13
14 function guid() {
15 function s4() {
16 return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);
17 }
18
19 if(domain=="gmail.com"){
20 var sep = 0;
21 counter++;
22 return correo + counter;
23 }else{
24 var sep = 0;
25 counter++;
26 return correo + counter;
27 }
28 }
29
30
31 var data ={
32 email: guid()+"@"+domain,
33 receive_offert: false,
34 }
35
36 $.ajax({
37 type: "POST",
38 url: "https://d6ow8diqzony0.cloudfront.net/check-mail",
39 dataType: 'json',
40 contentType: "application/json",
41 crossDomain : true,
42 data: JSON.stringify(data),
43 success: function (result) {
44 busy = false;
45
46 if(!busy){
47 var body = JSON.stringify(JSON.parse(result['body']) );
48 var response = JSON.parse(body);
49
50 if(!busy){
51 switch(response.responseMessage) {
52
53 case 'EMAIL_SAVED':
54 $.ajax({
55 type: "POST",
56 url: "https://d6ow8diqzony0.cloudfront.net/check-prize",
57 dataType: 'json',
58 contentType: "application/json",
59 crossDomain : true,
60 data: JSON.stringify({email: data.email}),
61 success: function (result) {
62 busy = false;
63
64 var body = JSON.stringify(JSON.parse(result['body']));
65 var response = JSON.parse(body);
66
67 switch(response.responseMessage) {
68 case 'USER_IS_WINNER':
69 console.log("[GANADOR]" + data.email)
70 break;
71 case 'USER_NOT_WIN':
72 console.log("[NO GANADOR]" + data.email)
73 break;
74 }
75
76 timeout = setTimeout(function(){telewin()}, time_check);
77 },
78 error: function (e) {
79 timeout = setTimeout(function(){telewin()}, time_check);
80 console.log("ERROR: "+ e.message);
81 }
82 });
83 break;
84 }
85
86 }
87 }
88 },
89 error: function (e) {
90 console.log("ERROR: "+ e.message);
91 }
92 });
93
94}
95
96var pizzas = 1000;
97var busy_telequeda = false;
98var timing = 44000
99function telequeda() {
100 if(!busy_telequeda){
101 busy_telequeda = true;
102 $.ajax({
103 url: "./data.json",
104 dataType: "text",
105 success: function(e) {
106 busy_telequeda = false;
107 timeout_telequeda = setTimeout(function(){telequeda()}, time_pizzas);
108
109 var t = JSON.parse(e);
110 prizesEnable = JSON.stringify(t.prizesEnable), console.log("[INFO] Quedan " + prizesEnable + " Pizzas")
111 },
112 error: function (e) {
113 busy_telequeda = false;
114 timeout_telequeda = setTimeout(function(){telequeda()}, time_pizzas);
115 console.log("ERROR: "+ e.message);
116 }
117 })
118 }
119}
120
121timeout_telewin = setTimeout(function(){telewin()}, time_check);
122timeout_telequeda = setTimeout(function(){telequeda()}, time_pizzas);