-
Notifications
You must be signed in to change notification settings - Fork 38
/
feeds.html
165 lines (115 loc) · 3.29 KB
/
feeds.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
---
---
<head>
<meta name="viewport" content="width=device-width">
<script src="//code.jquery.com/jquery-1.10.2.min.js" type="text/javascript"></script>
<script type="text/javascript" src="/js/tabletop.js"></script>
<script type="text/javascript" src="/js/jquery.timeago.js"></script>
<link href='https://fonts.googleapis.com/css?family=Raleway:400,400italic,700,300,800' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css">
<script type="text/javascript">
const spreadsheetId = "1KOafitsYQJdZyvdywnOLjxz_FI2yVlxw2IXU2XpEAiY";
fetch(
`https://docs.google.com/spreadsheets/d/${spreadsheetId}/gviz/tq?tqx=out:json`
)
.then(res => res.text())
.then(text => {
const json = JSON.parse(text.substr(47).slice(0, -2));
//console.log(json.table.rows);
for (var i=0; i < json.table.rows.length; i++){
$("#loading").toggle();
var count = 0;
for(i=0; i < json.table.rows.length; i++){
console.log(json.table.rows[i]);
var url = json.table.rows[i].c[2].v;
var title = url;
if (json.table.rows[i].c[1] != null){
var title = json.table.rows[i].c[1].v;
};
var sitename = json.table.rows[i].c[5].v;
var pubdate = json.table.rows[i].c[4].v;
var siteurl = json.table.rows[i].c[6].v;
var description = [];
if(count<50){
if (json.table.rows[i].c[3] != null){
description = json.table.rows[i].c[3].v;
}
}
$("#links").append("<div class='feeditem'><strong><img src='https://s2.googleusercontent.com/s2/favicons?domain_url="+siteurl+"'/><a class='linktitle' href='"+url+ "'>" + title + "</a><span><br>"+ sitename +" | </span></strong> <time class='timeago' datetime='"+pubdate+"'>"+pubdate+"</time><p>"+description+"...</p></div><hr>");
count++;
}
jQuery("time.timeago").timeago();
}
})
</script>
<style>
body{
background-color:#f3f3f3;
margin:0px;
font-family:raleway;
}
#links{
padding:40px;
background-color:white;
max-width:600px;
width:100%;
margin:auto;
border:2px solid #00ff00;
}
#infobox{
border:1px solid #00ff00;
padding:10px;
display:none;
}
.linktitle{
font-weight:600;
}
.feeditem{
overflow-wrap: break-word;
}
.feeditem img{
display:inline-block;
padding-right:10px;
margin-left:-25px;
}
span{
color:grey;
font-size:10px;
}
.feeditem a{
text-decoration:none;
color:black;
}
.feeditem a:hover{
text-decoration:underline;
}
hr{
width:70%;
margin-top:20px;
margin-bottom:20px;
}
time{
color:grey;
font-size:10px;
}
</style>
</head>
<body>
<div id="links">
<div id="infobox">This is a list of the feeds I'm reading. The page auto-updates every 10 minutes or so. Why? Because we need to resist the hyperfeeds and build our own small feeds in the open</div>
<span id="loading">
<div class="preloader-wrapper small active">
<div class="spinner-layer spinner-green-only">
<div class="circle-clipper left">
<div class="circle"></div>
</div><div class="gap-patch">
<div class="circle"></div>
</div><div class="circle-clipper right">
<div class="circle"></div>
</div>
</div>
</div>
</span>
</div>
{% include googleanalytics.html %}
</body>