commit 6e5fe246c8ab81bfd4f467b9a6052b28d751af55
Author: root <root@hub.scroll.pub>
Date: 2024-12-28 19:18:36 +0000
Subject: Initial commit
diff --git a/body.html b/body.html
new file mode 100644
index 0000000..18e3de0
--- /dev/null
+++ b/body.html
@@ -0,0 +1,27 @@
+<header>
+ <nav>
+ <div class="logo">PoliPulse</div>
+ <button class="menu-toggle" aria-label="Toggle menu">
+ <span></span><span></span><span></span>
+ </button>
+ </nav>
+</header>
+
+<main>
+ <section class="hero">
+ <h1>Latest in US Politics</h1>
+ <p>Stay informed with real-time political updates</p>
+ </section>
+
+ <section class="news-container">
+ <div class="loading-spinner" aria-label="Loading news">
+ <div class="spinner"></div>
+ </div>
+ <div id="news-feed" aria-live="polite"></div>
+ </section>
+</main>
+
+<footer>
+ <p>Built with passion by PoliPulse</p>
+ <p>Data sourced from Google News</p>
+</footer>
diff --git a/index.scroll b/index.scroll
new file mode 100644
index 0000000..fa9a08e
--- /dev/null
+++ b/index.scroll
@@ -0,0 +1,11 @@
+buildHtml
+baseUrl https://polipulse.scroll.pub
+metaTags
+ title US Politics News Feed
+ description Get the latest American political news from trusted sources
+ keywords politics, news, US politics, American politics, political news
+editButton /edit.html
+title US Politics News Feed
+style.css
+body.html
+script.js
diff --git a/prompt.json b/prompt.json
new file mode 100644
index 0000000..0e96629
--- /dev/null
+++ b/prompt.json
@@ -0,0 +1,20 @@
+{
+ "id": "msg_01J6dye6rpxKYnP5LFvsuPUX",
+ "type": "message",
+ "role": "assistant",
+ "model": "claude-3-5-sonnet-20241022",
+ "content": [
+ {
+ "type": "text",
+ "text": "I'll create a website that fetches and displays top political news from Google News using their RSS feeds.\n\n---domain---\npolipulse.scroll.pub\n\n---index.scroll---\nbuildHtml\nbaseUrl https://polipulse.scroll.pub\nmetaTags\n title US Politics News Feed\n description Get the latest American political news from trusted sources\n keywords politics, news, US politics, American politics, political news\neditButton /edit.html\ntitle US Politics News Feed\nstyle.css\nbody.html\nscript.js\n\n---body.html---\n<header>\n <nav>\n <div class=\"logo\">PoliPulse</div>\n <button class=\"menu-toggle\" aria-label=\"Toggle menu\">\n <span></span><span></span><span></span>\n </button>\n </nav>\n</header>\n\n<main>\n <section class=\"hero\">\n <h1>Latest in US Politics</h1>\n <p>Stay informed with real-time political updates</p>\n </section>\n\n <section class=\"news-container\">\n <div class=\"loading-spinner\" aria-label=\"Loading news\">\n <div class=\"spinner\"></div>\n </div>\n <div id=\"news-feed\" aria-live=\"polite\"></div>\n </section>\n</main>\n\n<footer>\n <p>Built with passion by PoliPulse</p>\n <p>Data sourced from Google News</p>\n</footer>\n\n---style.css---\n:root {\n --primary-color: #2a4365;\n --secondary-color: #ed8936;\n --bg-color: #f7fafc;\n --text-color: #2d3748;\n --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);\n}\n\n* {\n margin: 0;\n padding: 0;\n box-sizing: border-box;\n}\n\nbody {\n font-family: 'Segoe UI', system-ui, sans-serif;\n line-height: 1.6;\n color: var(--text-color);\n background: var(--bg-color);\n}\n\nheader {\n background: var(--primary-color);\n padding: 1rem;\n position: fixed;\n width: 100%;\n top: 0;\n z-index: 100;\n box-shadow: var(--shadow);\n}\n\nnav {\n max-width: 1200px;\n margin: 0 auto;\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n\n.logo {\n color: white;\n font-size: 1.5rem;\n font-weight: bold;\n text-transform: uppercase;\n letter-spacing: 1px;\n}\n\n.menu-toggle {\n display: none;\n}\n\nmain {\n margin-top: 4rem;\n padding: 2rem;\n}\n\n.hero {\n text-align: center;\n padding: 3rem 1rem;\n background: linear-gradient(135deg, var(--primary-color), #4a5568);\n color: white;\n border-radius: 1rem;\n margin-bottom: 2rem;\n}\n\n.hero h1 {\n font-size: 2.5rem;\n margin-bottom: 1rem;\n}\n\n.news-container {\n max-width: 800px;\n margin: 0 auto;\n}\n\n.news-item {\n background: white;\n padding: 1.5rem;\n margin-bottom: 1.5rem;\n border-radius: 0.5rem;\n box-shadow: var(--shadow);\n transform: translateY(0);\n transition: transform 0.3s ease;\n}\n\n.news-item:hover {\n transform: translateY(-5px);\n}\n\n.news-item h2 {\n color: var(--primary-color);\n margin-bottom: 0.5rem;\n}\n\n.news-item p {\n color: #718096;\n}\n\n.loading-spinner {\n display: flex;\n justify-content: center;\n padding: 2rem;\n}\n\n.spinner {\n width: 50px;\n height: 50px;\n border: 4px solid #f3f3f3;\n border-top: 4px solid var(--secondary-color);\n border-radius: 50%;\n animation: spin 1s linear infinite;\n}\n\n@keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n}\n\nfooter {\n background: var(--primary-color);\n color: white;\n text-align: center;\n padding: 2rem;\n margin-top: 4rem;\n}\n\n@media (max-width: 768px) {\n .hero h1 {\n font-size: 2rem;\n }\n \n .news-item {\n padding: 1rem;\n }\n}\n\n---script.js---\ndocument.addEventListener('DOMContentLoaded', function() {\n const newsFeed = document.getElementById('news-feed');\n const loadingSpinner = document.querySelector('.loading-spinner');\n\n async function fetchNews() {\n try {\n // Note: In a real implementation, you'd need a backend proxy to handle CORS\n // and API keys. This is a simplified example.\n const response = await fetch('https://news.google.com/rss/search?q=us+politics&hl=en-US&gl=US&ceid=US:en');\n const data = await response.text();\n const parser = new DOMParser();\n const xml = parser.parseFromString(data, 'text/xml');\n const items = xml.querySelectorAll('item');\n \n loadingSpinner.style.display = 'none';\n \n items.forEach(item => {\n const title = item.querySelector('title').textContent;\n const link = item.querySelector('link').textContent;\n const pubDate = new Date(item.querySelector('pubDate').textContent);\n \n const newsItem = document.createElement('article');\n newsItem.classList.add('news-item');\n newsItem.innerHTML = `\n <h2><a href=\"${link}\" target=\"_blank\" rel=\"noopener noreferrer\">${title}</a></h2>\n <p>${pubDate.toLocaleDateString('en-US', {\n weekday: 'long',\n year: 'numeric',\n month: 'long',\n day: 'numeric'\n })}</p>\n `;\n \n newsFeed.appendChild(newsItem);\n });\n } catch (error) {\n loadingSpinner.style.display = 'none';\n newsFeed.innerHTML = '<p>Error loading news. Please try again later.</p>';\n console.error('Error fetching news:', error);\n }\n }\n\n fetchNews();\n});\n\n---end---\n\nNote: Due to CORS restrictions, this implementation would need a backend proxy server to actually fetch from Google News RSS feeds. In a production environment, you'd want to implement proper error handling, rate limiting, and caching.\n\nThe design features a clean, modern interface with smooth animations, responsive layout, and accessibility considerations. The color scheme is professional yet engaging, with careful attention to typography and spacing."
+ }
+ ],
+ "stop_reason": "end_turn",
+ "stop_sequence": null,
+ "usage": {
+ "input_tokens": 283,
+ "cache_creation_input_tokens": 0,
+ "cache_read_input_tokens": 0,
+ "output_tokens": 1835
+ }
+}
\ No newline at end of file
diff --git a/readme.scroll b/readme.scroll
new file mode 100644
index 0000000..c6312cf
--- /dev/null
+++ b/readme.scroll
@@ -0,0 +1,2 @@
+# polipulse.scroll.pub
+Website generated by Claude from prompt: A webiste to get from google top news Item on american politics
\ No newline at end of file
diff --git a/script.js b/script.js
new file mode 100644
index 0000000..6ceec5e
--- /dev/null
+++ b/script.js
@@ -0,0 +1,44 @@
+document.addEventListener('DOMContentLoaded', function() {
+ const newsFeed = document.getElementById('news-feed');
+ const loadingSpinner = document.querySelector('.loading-spinner');
+
+ async function fetchNews() {
+ try {
+ // Note: In a real implementation, you'd need a backend proxy to handle CORS
+ // and API keys. This is a simplified example.
+ const response = await fetch('https://news.google.com/rss/search?q=us+politics&hl=en-US&gl=US&ceid=US:en');
+ const data = await response.text();
+ const parser = new DOMParser();
+ const xml = parser.parseFromString(data, 'text/xml');
+ const items = xml.querySelectorAll('item');
+
+ loadingSpinner.style.display = 'none';
+
+ items.forEach(item => {
+ const title = item.querySelector('title').textContent;
+ const link = item.querySelector('link').textContent;
+ const pubDate = new Date(item.querySelector('pubDate').textContent);
+
+ const newsItem = document.createElement('article');
+ newsItem.classList.add('news-item');
+ newsItem.innerHTML = `
+ <h2><a href="${link}" target="_blank" rel="noopener noreferrer">${title}</a></h2>
+ <p>${pubDate.toLocaleDateString('en-US', {
+ weekday: 'long',
+ year: 'numeric',
+ month: 'long',
+ day: 'numeric'
+ })}</p>
+ `;
+
+ newsFeed.appendChild(newsItem);
+ });
+ } catch (error) {
+ loadingSpinner.style.display = 'none';
+ newsFeed.innerHTML = '<p>Error loading news. Please try again later.</p>';
+ console.error('Error fetching news:', error);
+ }
+ }
+
+ fetchNews();
+});
diff --git a/style.css b/style.css
new file mode 100644
index 0000000..42e13f1
--- /dev/null
+++ b/style.css
@@ -0,0 +1,135 @@
+:root {
+ --primary-color: #2a4365;
+ --secondary-color: #ed8936;
+ --bg-color: #f7fafc;
+ --text-color: #2d3748;
+ --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
+}
+
+* {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+}
+
+body {
+ font-family: 'Segoe UI', system-ui, sans-serif;
+ line-height: 1.6;
+ color: var(--text-color);
+ background: var(--bg-color);
+}
+
+header {
+ background: var(--primary-color);
+ padding: 1rem;
+ position: fixed;
+ width: 100%;
+ top: 0;
+ z-index: 100;
+ box-shadow: var(--shadow);
+}
+
+nav {
+ max-width: 1200px;
+ margin: 0 auto;
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+}
+
+.logo {
+ color: white;
+ font-size: 1.5rem;
+ font-weight: bold;
+ text-transform: uppercase;
+ letter-spacing: 1px;
+}
+
+.menu-toggle {
+ display: none;
+}
+
+main {
+ margin-top: 4rem;
+ padding: 2rem;
+}
+
+.hero {
+ text-align: center;
+ padding: 3rem 1rem;
+ background: linear-gradient(135deg, var(--primary-color), #4a5568);
+ color: white;
+ border-radius: 1rem;
+ margin-bottom: 2rem;
+}
+
+.hero h1 {
+ font-size: 2.5rem;
+ margin-bottom: 1rem;
+}
+
+.news-container {
+ max-width: 800px;
+ margin: 0 auto;
+}
+
+.news-item {
+ background: white;
+ padding: 1.5rem;
+ margin-bottom: 1.5rem;
+ border-radius: 0.5rem;
+ box-shadow: var(--shadow);
+ transform: translateY(0);
+ transition: transform 0.3s ease;
+}
+
+.news-item:hover {
+ transform: translateY(-5px);
+}
+
+.news-item h2 {
+ color: var(--primary-color);
+ margin-bottom: 0.5rem;
+}
+
+.news-item p {
+ color: #718096;
+}
+
+.loading-spinner {
+ display: flex;
+ justify-content: center;
+ padding: 2rem;
+}
+
+.spinner {
+ width: 50px;
+ height: 50px;
+ border: 4px solid #f3f3f3;
+ border-top: 4px solid var(--secondary-color);
+ border-radius: 50%;
+ animation: spin 1s linear infinite;
+}
+
+@keyframes spin {
+ 0% { transform: rotate(0deg); }
+ 100% { transform: rotate(360deg); }
+}
+
+footer {
+ background: var(--primary-color);
+ color: white;
+ text-align: center;
+ padding: 2rem;
+ margin-top: 4rem;
+}
+
+@media (max-width: 768px) {
+ .hero h1 {
+ font-size: 2rem;
+ }
+
+ .news-item {
+ padding: 1rem;
+ }
+}