<!DOCTYPE html>
<html>
<head>
<title>RSS Feed Reader</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
/* Basic styles for mobile responsiveness */
body {
font-family: Arial, sans-serif;
font-size: 16px;
line-height: 1.5;
margin: 0;
padding: 0;
background-color: #f7f7f7;
}
.container {
max-width: 800px;
margin: 0 auto;
padding: 40px;
background-color: #fff;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.2);
border-radius: 5px;
}
.item {
padding: 20px 0;
border-bottom: 1px solid #e6e6e6;
transition: background-color 0.3s ease;
}
.item:last-of-type {
border-bottom: none;
}
.title {
font-weight: bold;
font-size: 1.2rem;
margin-bottom: 10px;
color: #333;
text-decoration: none;
transition: color 0.3s ease;
}
.title:hover {
color: #1a1a1a;
}
.description {
font-size: 1rem;
color: #333;
line-height: 1.4;
}
/* Styles for mobile responsiveness */
@media (max-width: 600px) {
.container {
max-width: 100%;
padding: 20px;
}
.item {
padding: 10px 0;
}
.title {
font-size: 1.1rem;
margin-bottom: 5px;
}
.description {
font-size: 0.9rem;
line-height: 1.3;
}
}
</style>
</head>
<body>
<div class="container">
<h1 style="text-align:center; margin-bottom: 30px;">RSS Feed Reader</h1>
<div id="rss-feed"></div>
</div>
<script>
// JavaScript to fetch and parse RSS feed
const feedUrl = "
https://nuclearcoffee.org/feed";
const feedContainer = document.getElementById("rss-feed");
fetch(feedUrl)
.then(response => response.text())
.then(xml => {
const parser = new DOMParser();
const doc = parser.parseFromString(xml, "application/xml");
const items = doc.querySelectorAll("item");
let html = "";
items.forEach(item => {
const title = item.querySelector("title").textContent;
const link = item.querySelector("link").textContent;
const description = item.querySelector("description").textContent;
html += `
<div class="item">
<a href="${link}" class="title" target="_blank">${title}</a>
<div class="description">${description}</div>
</div>
`;
});
feedContainer.innerHTML = html;
})
.catch(error => {
console.error(error);
feedContainer.textContent = "Error loading RSS feed.";
});
</script>
</body>
</html>