-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathblog.html
More file actions
234 lines (196 loc) · 9.36 KB
/
Copy pathblog.html
File metadata and controls
234 lines (196 loc) · 9.36 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
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<title>Medium Articles - Ragu</title>
<!-- SEO Tags -->
<meta name="description" content="We provide services in web development, web scraping, Telegram bots, Chrome extension development, and Arduino programming. Contact us to bring your ideas to life.">
<meta name="keywords" content="web development, web scraping, telegram bots, chrome extension, Arduino,ragu, ragug, Ragu, ragu website, ragu2k, ragu kec, RAGU, ragu eee, raguggg">
<meta name="author" content="RAGU G">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta name="google-site-verification" content="google7ab02f675b61b20e">
<!-- Open Graph / Facebook -->
<meta property="og:title" content="Our Services - Web Development, Web Scraping, Telegram Bots, and More">
<meta property="og:description" content="Explore our services to discover how we can help you with web development, web scraping, Telegram bots, Chrome extensions, Arduino projects, and more.">
<meta property="og:image" content="./assets/img/aboutpic.jpg">
<meta property="og:url" content="https://www.ragug.com/">
<!-- Google Tag Manager -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-X0WLPZ5VQY"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-X0WLPZ5VQY');
</script>
<!-- Favicons -->
<link href="assets/img/logo.png" rel="icon">
<link href="assets/img/logo.png" rel="apple-touch-icon">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i|Raleway:300,300i,400,400i,500,500i,600,600i,700,700i|Poppins:300,300i,400,400i,500,500i,600,600i,700,700i" rel="stylesheet">
<!-- Vendor CSS Files -->
<link href="assets/vendor/aos/aos.css" rel="stylesheet">
<link href="assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/vendor/bootstrap-icons/bootstrap-icons.css" rel="stylesheet">
<link href="assets/vendor/boxicons/css/boxicons.min.css" rel="stylesheet">
<link href="assets/vendor/glightbox/css/glightbox.min.css" rel="stylesheet">
<link href="assets/vendor/swiper/swiper-bundle.min.css" rel="stylesheet">
<!-- Template Main CSS File -->
<link href="assets/css/style.css" rel="stylesheet">
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<style>
body {
background-color: #f8f9fa;
}
.card-title {
color: #333;
}
.card-subtitle {
color: #666;
}
.btn-primary {
background-color: #007bff;
border: none;
}
.btn-primary:hover {
background-color: #0056b3;
}
.container {
padding-top: 50px;
}
.card-img-top {
height: 200px;
object-fit: cover;
}
.card-body {
height: 250px;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.description {
flex-grow: 1;
}
</style>
</head>
<body>
<!-- ======= Header ======= -->
<header id="header" class="fixed-top">
<div class="container-fluid d-flex justify-content-between align-items-center">
<h1 class="logo me-auto me-lg-0"><a href="index.html">RAGU</a></h1>
<nav id="navbar" class="navbar order-last order-lg-0">
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="about.html">About</a></li>
<li ><a class="active" href="blog.html">Blogs</a></li>
<li><a href="products.html">Products</a></li>
<li><a href="services.html">Services</a></li>
<li><a href="tools.html">Tools</a></li>
<li><a href="contact.html">Contact</a></li>
</ul>
<i class="bi bi-list mobile-nav-toggle"></i>
</nav><!-- .navbar -->
<div class="header-social-links">
<a href="mailto: ragu19062002@gmail.com"><i class="bi bi-envelope-at"></i></a>
<a href="http://api.whatsapp.com/send?phone=+917598226670&text=Hi Ragu" target="_"><i class="bi bi-whatsapp"></i></a>
<a href="tg://resolve?domain=ragu2k"><i class="bi bi-telegram"></i></a>
<a href="https://www.instagram.com/_ragug_/" target="_"><i class="bi bi-instagram"></i></a>
<a href="https://www.linkedin.com/in/ragug/" target="_"> <i class="bi bi-linkedin"></i></a>
<a href="https://www.ragug.com/" target="_"><i class="bi bi-github"></i></a>
</div>
</div>
</header><!-- End Header -->
<main id="main">
<div>
<h2>Blogs-blog</h2>
</div>
<div class="container">
<div class="row" id="articles-row"></div>
</div>
</main>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.4/dist/umd/popper.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", () => {
const url = 'https://api.rss2json.com/v1/api.json?rss_url=https://medium.com/feed/@ragug';
const articlesRow = document.getElementById('articles-row');
const defaultImage = 'assets/img/medium.png'; // Specify the path to your default image here
// Function to fetch data from the API
async function fetchArticles() {
try {
const response = await fetch(url);
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
const data = await response.json();
displayArticles(data.items);
} catch (error) {
console.error('Error fetching data:', error);
}
}
// Function to display articles
function displayArticles(articles) {
articles.forEach(article => {
const col = document.createElement('div');
col.className = 'col-lg-4 col-md-6 mb-4';
const card = document.createElement('div');
card.className = 'card mb-3';
card.style.width = '100%';
const image = document.createElement('img');
image.className = 'card-img-top';
image.alt = article.title;
const thumbnailUrl = extractThumbnail(article.description) || defaultImage;
image.src = thumbnailUrl;
const cardBody = document.createElement('div');
cardBody.className = 'card-body';
const cardTitle = document.createElement('h5');
cardTitle.className = 'card-title';
cardTitle.textContent = article.title;
const cardSubtitle = document.createElement('h6');
cardSubtitle.className = 'card-subtitle mb-2 text-muted';
cardSubtitle.textContent = new Date(article.pubDate).toLocaleDateString();
const description = document.createElement('p');
description.className = 'card-text description';
description.textContent = truncateDescription(article.description, 156 - article.title.length)
const link = document.createElement('a');
link.href = article.link;
link.className = 'btn btn-primary';
link.textContent = 'Read More';
link.target = "_blank";
cardBody.appendChild(cardTitle);
cardBody.appendChild(cardSubtitle);
cardBody.appendChild(description);
cardBody.appendChild(link);
card.appendChild(image);
card.appendChild(cardBody);
col.appendChild(card);
articlesRow.appendChild(col);
});
}
// Function to extract thumbnail from the article description
function extractThumbnail(description) {
const parser = new DOMParser();
const doc = parser.parseFromString(description, 'text/html');
const figure = doc.querySelector('figure');
if (figure) {
const img = figure.querySelector('img');
if (img) {
return img.src;
}
}
return null;
}
// Function to truncate description
function truncateDescription(description, maxLength) {
const parser = new DOMParser();
const doc = parser.parseFromString(description, 'text/html');
const text = doc.body.textContent || "";
return text.length > maxLength ? text.substring(0, maxLength) + "..." : text;
}
// Fetch articles on page load
fetchArticles();
});
</script>
</body>
</html>