-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
42 lines (40 loc) · 1.23 KB
/
Copy pathindex.html
File metadata and controls
42 lines (40 loc) · 1.23 KB
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
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script src="/socket.io/socket.io.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
<style type="text/css">
body {
background-color: #3b2f63;
}
img {
margin: 5px;
}
</style>
<title>Apache Kafka on Heroku Demo</title>
</head>
<body>
<script>
$(function() {
var socket = io.connect();
socket.on('msg', function(data) {
console.log(data);
user = '<img src=\"' + data.user.profile_image_url + '\">';
text = data.text;
$('#stream').prepend( '<div class=\"well\"><p>' + user + text + '</p></div>');
});
});
</script>
<div id="stream" class="container">
</div>
</body>
</html>