-
Notifications
You must be signed in to change notification settings - Fork 0
/
guestbook.html
68 lines (48 loc) · 1.67 KB
/
guestbook.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
<html>
<head>
<title>guestbook | jamesunderwood.net</title>
<style>
.guestbooklisting {
margin-left: 10%;
margin-right: 10%;
margin-top: 15px;
background: lightblue;
padding: 5px;
border: 1.5px solid black;
border-radius: 4px;
}
body {
background-image: url("/assets/5002.png");
background-attachment: fixed;
}
</style>
</head>
<body>
<center>
<img src="/assets/guestbook.gif" style="width:200px">
<h1>~ guestbook ~</h1>
<button onclick="window.open('/guestbookpost.html','name','width=610,height=250,resizable=0')">leave a message</button>
<div id="container">
</div>
<img src="/assets/guestbook2.gif" style="width:200px">
</center>
<script src="jquery-3.6.0.min.js"></script>
<script>
$("#container").html("");
$.get("https://docs.google.com/spreadsheets/d/14ZEKnnMLlv9dS8nNlgRI70Ine9_eWFMErjOehHpp2-g/export?format=csv&id=14ZEKnnMLlv9dS8nNlgRI70Ine9_eWFMErjOehHpp2-g", function(data, status) {
var arraylet = data.split(/\r?\n/);
arraylet = arraylet.splice(1, arraylet.length);
var arraylet2 = arraylet.filter(function(value, index, arr){
return value !== "0/0/0000 00:00:00,del";
});
arraylet2.forEach(function(val) {
let ttt = val.substring(val.indexOf(":") + 7, val.length);
$('<div class="guestbooklisting" /><p class="postp" ').text(ttt).appendTo('#container');
});
arraylet2.forEach(function(val, i) {
$(".guestbooklisting").eq(i).prepend("<small>" + val.split(" ")[0] + "</small><br>");
});
});
</script>
</body>
</html>