Tag: Forever Miss India

Lifestyle
bg
Kolkata’s Adrija Ray Crowned Forever Miss India 2024 at Zee Studios Jaipur

Kolkata’s Adrija Ray Crowned Forever Miss India 2024 at...

Adrija Ray from Kolkata has been crowned Forever Miss India 2024 at a dazzling grand...

Lifestyle
bg
Adrija Ray Choudhury Emerges Triumphant as Miss Howrah 2024 at Forever Miss India City Finale

Adrija Ray Choudhury Emerges Triumphant as Miss Howrah...

In this prestigious event, models from various cities across the country were crowned...

Lifestyle
bg
Victory for Parul Patel as She Clinches Mrs Surat 2024 Title at City Finale

Victory for Parul Patel as She Clinches Mrs Surat 2024...

Becoming Mrs Surat 2024 is a significant milestone in Parul’s life, placing her...

Lifestyle
bg
New Star on the Rise: Shraddha Mishra Wins Miss Varanasi 2024

New Star on the Rise: Shraddha Mishra Wins Miss Varanasi...

Shradhha Mishra, a team leader in a finance company, has been named Miss Varanasi...

Lifestyle
bg
Dr. Santoshi Karwe Emerges Triumphant as Mrs Navi Mumbai 2024 at Forever Miss India City Finale

Dr. Santoshi Karwe Emerges Triumphant as Mrs Navi Mumbai...

Becoming Mrs Navi Mumbai  2024 is a significant milestone in Dr. Santoshi’s life,...

Lifestyle
bg
Shweta Prajapati  Emerges Triumphant as Miss Vadodara 2024 at Forever Miss India City Finale

Shweta Prajapati Emerges Triumphant as Miss Vadodara 2024...

Forever Star India organized the grand beauty pageant Forever Miss, Mrs., and Miss...

Lifestyle
bg
Shining Star: Anushka Patel Wins Miss Teen Raipur 2024 at Prestigious Forever Miss India Event

Shining Star: Anushka Patel Wins Miss Teen Raipur 2024...

In this prestigious event, models from various cities across the country were crowned...

Lifestyle
Sonali Shree Shines as Miss Motihari 2023, Heading to Grand Finale of Forever Miss India

Sonali Shree Shines as Miss Motihari 2023, Heading to Grand...

 Sonali Shree has emerged as the shining star after being crowned Miss Motihari...

// JavaScript Code for SCNWire News Widget with API and RSS Feed Fallback (function () { // Configuration const widgetContainerId = "scnwire-news-widget"; // ID of the container where the news will be displayed const apiUrl = "https://www.scnwire.com/api/news"; // Replace with the actual API endpoint const rssFeedUrl = "https://www.scnwire.com/rss.xml"; // RSS Feed URL const newsLimit = 5; // Number of news items to display const widgetStyles = ` #${widgetContainerId} { font-family: Arial, sans-serif; max-width: 400px; margin: 0 auto; padding: 20px; border: 1px solid #e0e0e0; border-radius: 8px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); background-color: #ffffff; } #${widgetContainerId} h2 { font-size: 1.5rem; margin-bottom: 16px; color: #333333; } #${widgetContainerId} .news-item { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #e0e0e0; } #${widgetContainerId} .news-item:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; } #${widgetContainerId} .news-item h3 { font-size: 1.1rem; margin: 0 0 8px 0; color: #007BFF; } #${widgetContainerId} .news-item p { font-size: 0.9rem; margin: 0; color: #666666; } #${widgetContainerId} .news-item a { color: inherit; text-decoration: none; } #${widgetContainerId} .news-item a:hover { text-decoration: underline; } `; // Inject styles into the document const styleSheet = document.createElement("style"); styleSheet.type = "text/css"; styleSheet.innerText = widgetStyles; document.head.appendChild(styleSheet); // Create the widget container const widgetContainer = document.createElement("div"); widgetContainer.id = widgetContainerId; widgetContainer.innerHTML = `

Latest News from SCNWire

`; document.body.appendChild(widgetContainer); // Fetch news data from API async function fetchNewsFromAPI() { try { const response = await fetch(apiUrl); if (!response.ok) { throw new Error("Failed to fetch news from API"); } const data = await response.json(); return data.slice(0, newsLimit); // Limit the number of news items } catch (error) { console.error("Error fetching news from API:", error); return null; // Return null if API fails } } // Fetch and parse RSS feed async function fetchNewsFromRSS() { try { const response = await fetch(rssFeedUrl); if (!response.ok) { throw new Error("Failed to fetch RSS feed"); } const text = await response.text(); const parser = new DOMParser(); const xmlDoc = parser.parseFromString(text, "text/xml"); const items = xmlDoc.querySelectorAll("item"); return Array.from(items).slice(0, newsLimit).map((item) => ({ title: item.querySelector("title").textContent, description: item.querySelector("description").textContent, link: item.querySelector("link").textContent, })); } catch (error) { console.error("Error fetching RSS feed:", error); return null; // Return null if RSS feed fails } } // Display news in the widget function displayNews(newsItems) { if (!newsItems || newsItems.length === 0) { widgetContainer.innerHTML += `

No news available at the moment.

`; return; } newsItems.forEach((item) => { const newsItem = document.createElement("div"); newsItem.className = "news-item"; newsItem.innerHTML = `

${item.title}

${item.description}

`; widgetContainer.appendChild(newsItem); }); } // Initialize the widget async function initializeWidget() { let newsItems = await fetchNewsFromAPI(); // Try fetching from API first if (!newsItems) { newsItems = await fetchNewsFromRSS(); // Fallback to RSS feed if API fails } displayNews(newsItems); } initializeWidget(); })();