Weather Today | Accurate Forecast, Live Satellite, Air Quality
// Function to dynamically update the meta description
function updateMetaDescription() {
// Extract all text content from the
const bodyText = document.body.innerText || document.body.textContent;
// Split the text into sentences using regex
const sentences = bodyText.match(/[^.!?]+[.!?]*/g) || [];
// Join sentences to create the meta description
let metaDescription = sentences.join(' ').trim();
// Capitalize the first letter of the description
metaDescription = metaDescription.charAt(0).toUpperCase() + metaDescription.slice(1);
// Limit the meta description to 160 characters (recommended for SEO)
metaDescription = metaDescription.substring(0, 160);
// Find the existing meta description tag or create a new one
let metaTag = document.querySelector('meta[name="description"]');
if (!metaTag) {
metaTag = document.createElement('meta');
metaTag.name = "description";
document.head.appendChild(metaTag);
}
// Update the meta description content
metaTag.content = metaDescription;
}
// Run the function when the page loads
window.onload = updateMetaDescription;
function toggleSearch(){var e=document.getElementById("search-container");e.style.display="none"===e.style.display||""===e.style.display?"block":"none"}
const chatGPTLink=document.getElementById("chatGPTLink"),modal=document.getElementById("phindModal"),closeBtn=document.querySelector(".close-btn");chatGPTLink.addEventListener("click",()=>{modal.style.display="flex"}),closeBtn.addEventListener("click",()=>{modal.style.display="none"}),window.addEventListener("click",e=>{e.target===modal&&(modal.style.display="none")}); x server