LiterateInk
API

News

Read latest news concerning a given feed.

Listing news

Let's say we want to list latest news by showing their name and category, but not their content.

import * as crous from "crowous";
 
const news = await crous.news("limoges");
 
for (const article of news) {
  console.log(`[${article.category}]: ${article.title}, published @ ${article.publicationDate.toLocaleDateString()}`);
  // You can retrieve the HTML content of the article by using `article.content`.
  // We're not doing it here to avoid cluttering the console.
}
output.txt
[restos]: Le Crous recrute pour la rentrée, published @ 7/1/2022
[general]: Le paiement des bourses, published @ 12/15/2021
[aides]: PLATEFORME D’ÉCOUTE ET DE SOUTIEN PSYCHOLOGIQUE, published @ 7/21/2021
...

On this page