// GNews API key and keywords const apiKey = 'ba80327ee808107950ed733e783b2c3a'; const keywords = 'ESKD,ESRD,Kidney Disease,Renal Disease,Kidney Transplant,Dialysis'; const apiUrl = `https://gnews.io/api/v4/search?q=${encodeURIComponent(keywords)}&lang=en&from=${getPastDate()}&token=${apiKey}&max=10`; // Helper function to get the date 7 days ago in yyyy-mm-dd format function getPastDate() { const date = new Date(); date.setDate(date.getDate() - 7); return date.toISOString().split('T')[0]; } // Fetch data from GNews API fetch(apiUrl) .then(response => { if (!response.ok) { throw new Error(`Network response was not ok: ${response.statusText}`); } return response.json(); }) .then(data => { if (data.articles && data.articles.length > 0) { displayNews(data.articles); } else { throw new Error("No articles found in response data"); } }) .catch(error => { console.error('Error fetching data:', error); document.getElementById('news-container').innerHTML = '

Unable to load news articles at this time.

'; }); // Display news articles function displayNews(articles) { const newsContainer = document.getElementById('news-container'); newsContainer.innerHTML = ''; // Clear any existing content articles.forEach(article => { const articleElement = document.createElement('div'); articleElement.style.marginBottom = '10px'; // Use innerText for plain text and anchor element for the link articleElement.innerHTML = `

${new Date(article.publishedAt).toLocaleDateString()} - ${article.title}

Read more

`; newsContainer.appendChild(articleElement); }); }
top of page

About

The Full Story

This is your About page. This space is a great opportunity to give a full background on who you are, what you do and what your site has to offer. Your users are genuinely interested in learning more about you, so don’t be afraid to share personal anecdotes to create a more friendly quality. Every website has a story, and your visitors want to hear yours. This space is a great opportunity to provide any personal details you want to share with your followers. Include interesting anecdotes and facts to keep readers engaged. Double click on the text box to start editing your content and make sure to add all the relevant details you want site visitors to know. If you’re a business, talk about how you started and share your professional journey. Explain your core values, your commitment to customers and how you stand out from the crowd. Add a photo, gallery or video for even more engagement.

Let’s Work Together

Get in touch so we can start working together.

  • Facebook
  • Twitter
  • LinkedIn
  • Instagram

Thanks for submitting!

  • alt.text.label.Facebook

©2023 by Renal Travel Today. Proudly created with Wix.com

bottom of page