-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoticias.html
134 lines (102 loc) · 5.12 KB
/
noticias.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Garza News</title>
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="Free HTML Templates" name="keywords">
<meta content="Free HTML Templates" name="description">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.0/css/all.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link href="css/style2.css" rel="stylesheet">
</head>
<body>
<div class="container-fluid">
<div class="row align-items-center bg-light px-lg-5">
<div class="col-12 col-md-8">
<div class="d-flex justify-content-between">
<div><a href="https://somos.dwggl.com/acerca"><img width="250px" src="img/ggl.jpg" ></a></div>
<div class="owl-carousel owl-carousel-1 tranding-carousel position-relative d-inline-flex align-items-center ml-3" style="width: calc(100% - 100px); padding-right: 90px;">
<div class="text-truncate"><a class="text-secondary" >Noticias de Ultima Hora</a></div>
</div>
</div>
</div>
<div class="col-md-4 text-right d-none d-md-block">
<label id="fecha"></label>
<script>
var hoy = new Date();
var formato = { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' };
formato.timeZoneName = 'short';
var hoy = hoy.toLocaleString('es-ES', formato);
document.getElementById('fecha').innerHTML=hoy
</script>
</div>
</div>
<div class="row align-items-center py-2 px-lg-5">
<div class="col-lg-4">
<a href="" class="navbar-brand d-none d-lg-block">
<h1 class="m-0 display-5 text-uppercase"><span class="text-primary">Garza</span>News</h1>
</a>
</div>
<div class="col-lg-8 text-center text-lg-right">
</div>
</div>
</div>
<!-- Navbar Start -->
<div class="container-fluid p-0 mb-3">
<nav class="navbar navbar-expand-lg bg-light navbar-light py-2 py-lg-0 px-lg-5">
<a href="" class="navbar-brand d-block d-lg-none">
<h1 class="m-0 display-5 text-uppercase"><span class="text-primary">News</span>Room</h1>
</a>
<button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbarCollapse">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-between px-0 px-lg-3" id="navbarCollapse">
<div class="navbar-nav mr-auto py-0">
<a href="index.html" class="nav-item nav-link active">Cerrar sesion</a>
</div>
<a href="https://somos.dwggl.com/contacto" class="nav-item nav-link">Contacto</a>
</div>
<div class="input-group ml-auto" style="width: 100%; max-width: 300px;">
<input type="text" class="form-control" placeholder="Ilustrativo">
<div class="input-group-append">
<button class="input-group-text text-secondary"><i
class="fa fa-search"></i></button>
</div>
</div>
</div>
</nav>
</div>
<div class="container mt-4 shadow-lg p-3 mb-5 bg-body rounded">
<table>
<tbody id="data">
</tbody>
<tbody id="data2">
</tbody>
</table>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta3/dist/js/bootstrap.bundle.min.js" integrity="sha384-JEW9xMcG8R+pH31jmWH6WWP0WintQrMb4s7ZOdauHnUtxwoG2vI5DkLtS3qm9Ekf" crossorigin="anonymous"></script>
<script>
let url = 'https://notigram.com/wp-json/wp/v2/posts?per_page=10&status=publish&page=1&_embed';
let url2 = 'https://notigram.com/wp-json/wp/v2/posts/1103039?_embed';
fetch(url)
.then(response => response.json())
.then(data => mostrar(data))
.then(json => console.log(json))
fetch(url2)
.then(response => response.json())
.then(data => mostrar(data))
.then(json => console.log(json))
const mostrar=(data)=>{
console.log(data)
let body =""
for(var i=0; i < data.length; i++){
body+= `<tr><td>${data[i].content.rendered}</td></tr>`
}
document.getElementById('data').innerHTML = body
}
</script>
</div>
</body>
</html>