-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
210 lines (178 loc) · 7.99 KB
/
index.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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE html>
<html lang="es" >
<head>
<meta charset="UTF-8">
<title>GeoIniciativas en Español</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css">
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
<script src="https://unpkg.com/vue-router/dist/vue-router.js"></script>
<script src="assets/js/moment.min.js"></script>
<script src="assets/js/moment-with-locales.js"></script>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<link rel="alternate" type="application/rss+xml" title="Agregador de GeoBlogs" href="http://www.feedrinse.com/services/channel/?chanurl=598b30eef2bd60fa1feeb65dafe67a32" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-fork-ribbon-css/0.2.3/gh-fork-ribbon.min.css" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous">
<style>
body{
font-size: .85rem;
}
#intro {
margin-top: 5rem;
}
#article-list{
padding: 0;
}
#article-list li{
list-style: none;
margin-bottom: 2rem;
}
.rss-icon{
width: 30px;
vertical-align: middle;
padding-bottom: 7px;
}
.nav-item{
padding: 0 1rem;
}
.navbar-brand a{
color: white;
}
.footer {
width: 100%;
background-color: #f5f5f5;
padding: 1rem;
}
h2{
font-size: 1.3rem;
position: relative;
}
h2 .anchor{
top: -125px;
position: relative;
}
}
</style>
</head>
<body>
<a class="github-fork-ribbon" href="https://github.com/Geo-Developers/agregador-de-geoblogs" data-ribbon="Fork me on Github" title="Fork me on GitHub">Fork me on GitHub</a>
<div id="app">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark fixed-top">
<div class="container">
<span class="navbar-brand d-lg-inline-block">
<router-link to="/">Agregador de Blogs "Geo"</router-link>
</span>
<div class="w-100 text-right">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#myNavbar">
<span class="navbar-toggler-icon"></span>
</button>
</div>
<div class="collapse navbar-collapse flex-grow-1 text-right" id="myNavbar">
<ul class="navbar-nav ml-auto flex-nowrap">
<li class="nav-item">
<a href="https://github.com/Geo-Developers/agregador-de-geoblogs#agregador-de-geoblogs" class="nav-link">Contribuir</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-sm">
<div id="intro">
<router-view></router-view>
</div>
</div>
</div>
</div>
</div>
<footer class="footer">
<div class="container text-center">
<span class="text-muted small">
Página desarrollada con ❤️ y licenciada bajo <a rel="license" href="http://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>.
</span>
</div>
</footer>
<script type="text/x-template" id="article-list">
<div class="mt-3">
<h2 class="text-center">Últimas noticias</h2>
<p class="text-center">
Agregador de noticias de blogs sobre GIS/Geo en Español
<a href="http://www.feedrinse.com/services/channel/?chanurl=598b30eef2bd60fa1feeb65dafe67a32">
<img src="https://upload.wikimedia.org/wikipedia/commons/b/b6/Rss_Shiny_Icon.svg" class="rss-icon">
</a>
<br>
<span class="small">
<a href="https://docs.google.com/spreadsheets/d/1bF4YYH7bXPSLI___zMfh3tDfSxDlWWZLkkuT5vD4zHQ/edit#gid=75088066">Listado de fuentes</a>
| Descargar: <a id="btnDownload" onclick="downloadTab('1bF4YYH7bXPSLI___zMfh3tDfSxDlWWZLkkuT5vD4zHQ', 3)" href="#">CSV</a> /
<a href="https://github.com/Geo-Developers/agregador-de-geoblogs/blob/main/geoblogs.opml">OPML</a>
</span>
</p>
<ol id="article-list" v-if="posts">
<li v-for="post in posts">
<div v-if="post.title" class="card">
<div class="card-body">
<h2><a v-bind:href="post.link">{{ post.title }}</a></h2>
<p class="small">
<strong>Publicado:</strong> {{ moment(post.pubDate, 'YYYY-MM-DD h:mm:ss', 'es').fromNow() }} ({{ moment(post.pubDate, 'YYYY-MM-DD h:mm:ss', 'es').calendar() }}) |
<strong>Fuente:</strong> <a v-bind:href="getHostnameFromRegex(post.link,0)">{{ getHostnameFromRegex(post.link) }}</a>
</p>
<div v-html="post.content"></div>
<div style="text-align: right">
<a v-bind:href="post.link" class="btn btn-primary">Leer más</a>
</div>
</div>
</div>
</li>
</ol>
<div v-else class="text-center">
<p>Lo sentimos, no se han podido cargar <a href="http://www.feedrinse.com/services/channel/?chanurl=598b30eef2bd60fa1feeb65dafe67a32">las noticias desde el servidor</a>, por favor intentételo más tarde.</p>
<iframe src="https://giphy.com/embed/qA9BnxUPmgWgU" width="480" height="235" frameBorder="0" class="giphy-embed" allowFullScreen></iframe><p><a href="https://giphy.com/gifs/puss-prewedding-summerbird-qA9BnxUPmgWgU">via GIPHY</a></p>
</div>
</div>
</script>
<script>
function fetchMarkdown(){
const markdownUrl = 'https://geo-developers.github.io/geoiniciativas/README.md';
return fetch(markdownUrl).then(response => response.text())
}
function fetchNews(){
const feedURL = 'http://www.feedrinse.com/services/channel/?chanurl=598b30eef2bd60fa1feeb65dafe67a32',
apikey = 'qreyxurezorzaujv0y5zsddrjmeukjmjywgdfygg',
feed2json = `https://api.rss2json.com/v1/api.json?rss_url=${encodeURIComponent(feedURL)}&api_key=${apikey}&count=50`;
return fetch(feed2json).then((response) => {
if (response.ok){
return response.json();
}else{
return {items: null}
}
});
}
function initPage(){
return Promise.all([fetchMarkdown(), fetchNews()]);
}
initPage().then(([markdown, news]) => {
moment.locale('es');
const ArticleList = Vue.component('article-list',{
template: '#article-list',
data (){
return {
posts: news.items
}
}
});
const routes = [{ path: '/', component: ArticleList }];
const router = new VueRouter({
routes,
})
var app = new Vue({
el: '#app',
router
});
});
const getHostnameFromRegex = (url, param = 1) => {
const matches = url.match(/^https?\:\/\/([^\/?#]+)(?:[\/?#]|$)/i);
return matches && matches[param];
};
</script>
</body>
</html>