This repository has been archived on 2021-01-18. You can view files and clone it, but cannot push or open issues or pull requests.
news_channel/src/index.ts

13 lines
408 B
TypeScript

const axios = require('axios').default;
const parser = new DOMParser();
axios.get('https://nieuws.nl/feed/')
.then(function (response: any) {
const news = parser.parseFromString(response.data, 'text/xml');
news.querySelectorAll("item").forEach((item: any) => {
console.log(item.title);
});
})
.catch(function (error: any) {
console.log(error);
});