-
Notifications
You must be signed in to change notification settings - Fork 0
/
about.html
122 lines (112 loc) · 4.74 KB
/
about.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Employifai</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="https://cdn.firebase.com/js/client/2.4.1/firebase.js"></script>
</head>
<body>
<h1>Employifai</h1>
<h2>The Facebook Cleanser</h2>
<p class="starts">Click here to find what shouldn't be on Facebook.</p>
<p><button class="button" id="login">Login</button></p>
<p><button class="button" id="run"><a href="#res">Wait</a></button></p>
<p id="output"></p>
<p>
<div class="loader" id="done">
<div class="loader__bar"></div>
<div class="loader__bar"></div>
<div class="loader__bar"></div>
<div class="loader__bar"></div>
<div class="loader__bar"></div>
<div class="loader__ball"></div>
</div>
</p>
<script>
// var ref = new Firebase("https://team-red.firebaseio.com");
// ref.remove();
var ref = new Firebase("https://team-red.firebaseio.com");
var queue = ref.child("queue");
var photos = ref.child("photos");
var final_photos = ref.child("final_photos");
queue.onAuth(function (user) {
console.log("in on auth")
console.log(user)
if (!user) return
console.log(user)
result = queue.push(user.facebook.accessToken);
console.log(user.accessToken, result.toString())
})
final_photos.on("child_added", function (snap) {
photos.remove();
console.log(snap.val())
var bad= snap.val().high;
var medium= snap.val().medium;
// var bad = ["asdads"]
// var medium = ["asdads"]
var low = []
console.log(bad);
if (!snap.val()) return;
if(bad[0]['url']==0 && medium[0]['url']==0 ) {
document.querySelector("#run").innerHTML = '<a href="#res">Congrats</a>';
document.querySelector("#output").innerHTML += '<h3 class=res2 id=res>No Results Found!</h3>';
}
else{
document.querySelector("#run").innerHTML = '<a href="#res">See Results</a>';
document.querySelector("#output").innerHTML += '<h3 class=res id=res>Results</h3>';
}
console.log(bad);
document.querySelector("#done").innerHTML = '';
if (bad[0]['url'] != 0){
document.querySelector("#output").innerHTML += '<div class="high"></div>';
document.querySelector(".high").innerHTML += '<h3 class=highH>Dangerous</h3>';
for (var i = 0; i < bad.length; i++) {
linkss=bad[i]['link'];
urls=bad[i]['url'];
document.querySelector(".high").innerHTML += '<p class="stack-high"><a class="pic" href='+linkss+'><img src='+urls+' alt="W3Schools.com" style=></a></p>';
//document.querySelector("#output").innerHTML += ;
// document.querySelector("#output").innerHTML += ;
}
console.log(bad);
// document.querySelector("#output").innerHTML += '</div>';
}
// const warning="http://vignette2.wikia.nocookie.net/age-of-ishtaria/images/f/f2/Warning-icon-hi.png/revision/latest?cb=20141214024456";
if (medium[0]['url']!=0){
console.log(bad);
document.querySelector("#output").innerHTML += '<div class="medium"></div>';
document.querySelector(".medium").innerHTML += '<h3 class=mediumH>Risky</h3>';
for (var i = 0; i < medium.length; i++) {
linkss=medium[i]['link'];
urls=medium[i]['url'];
console.log(medium[i]);
document.querySelector(".medium").innerHTML += '<p class="stack-med"><a class="pic" href='+linkss+'><img src='+urls+' alt="W3Schools.com" style=></a></p>';
console.log(bad);
}
// document.querySelector("#output").innerHTML += '</div>';
console.log(bad);
}
console.log(bad);
//document.querySelector("#output").innerHTML += bad[1];
//if(!snap.val().high.length==0) {
/// document.querySelector("#output").innerHTML = '<p class="stack"><img src=snap.val().high[0] alt="W3Schools.com" style="width:42px;height:42px;border:0;"></p>';
// document.querySelector("#output").innerHTML += '<p class="stack"><img src=snap.val().high[0] alt="image1" style="width:42px;height:42px;border:0;"></p>';
// }
});
function FaceBookLogin() {
queue.authWithOAuthRedirect("facebook", function(error) {
console.log("auth callback")
if (error) {
console.log("Login Failed!", error);
} else {
// We'll never get here, as the page will redirect on success.
}
},{
scope: "user_photos"
});
// return ref;
}
document.querySelector("#login").onclick = FaceBookLogin
</script>
</body>
</html>