-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·108 lines (81 loc) · 2.91 KB
/
index.php
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
<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST');
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Monitor Ya Bitch Ass</title>
<script src="https://cdn.firebase.com/js/client/2.4.2/firebase.js"></script>
<!--Bootstrap-->
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Optional theme
,
success: function(response){
alert(response.message);
alert(response.keys);
},
error: function(response) {
alert(response);
}-->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script>
$(function(){
$('#submit').click(function(){
var myString = $('#myString').val()
window.alert(myString);
var uri = "http://localhost:5000/?any="+encodeURIComponent(myString)
alert(uri);
$.ajax({
url: uri,
type: "post",
datatype:"text",
data: {'myString': 'myString'}
})
.done(function() {
alert("here");
});
});
});
</script>
<script>
var ref = new Firebase("https://sigjesus.firebaseio.com/")
ref.child('messages').on('value', function(snapshot){
snapshot.forEach(function(messages){
var key = messages.val();
console.log(key)
})
})
</script>
</head>
<body>
<style>
body { padding-top: 70px;
padding-left: 20px;
}
.row { padding-top: 70px;
padding-bottom: 70px; }
span.glyphicon {
font-size: 50px;
}
</style>
<nav class="navbar navbar-inverse navbar-fixed-top" id="nav">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="#nav">MonitorYourTexts</a> </div>
</div>
</nav>
<form>
<h1>What are you planning on saying?</h1>
<textarea class="form-control" rows="3" value="What is the message you are thinking of sending?" id="myString" type="text"></textarea>
<button id="submit" type="submit"class="btn btn-default">Whats the sentiment?</button>
</form>
<!-- JavaScript files should be linked at the bottom of the page -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</body>
</html>