TNEU News
Get latest news from tneu.edu.ua
Install
Ensure you have Node.js version 4 or higher installed. Then run the following:
$ yarn add tneu-news
Usage
const news = ; news ; news ;
API
getSnippets([page], [count])
Get specific number of news snippets by page number
[page] | [count] |
---|---|
Number (1 ) |
Number (15 ) |
Returns a Promise resolving array of objects:
title: 'На кафедрі фінансів імені...' date: 'Sun Sep 18 2016 19:31:25 GMT+0300 (EEST)' topic: 'Міжнародні програми' imageLink: 'http://www.tneu.edu.ua/uploads/posts/2016-09/....' description: '14 вересня 2016 р. студенти та викладачі кафедри фінансів...' readMoreLink: 'http://www.tneu.edu.ua/news/9678-na-kafedri....' /* 14 more... */
getArticle(link)
Get news article by direct link
Returns a Promise resolving article object:
title: 'На кафедрі фінансів імені...' date: 'Sun Sep 18 2016 19:31:25 GMT+0300 (EEST)' imageLink: 'http://www.tneu.edu.ua/uploads/posts/2016-09/....' author: 'Відділ інформації та зв`язків з громадськістю ' text: '14 вересня 2016 р. студенти та викладачі кафедри фінансів...' photos: 'http://www.tneu.edu.ua/uploads/posts/...' '....' attachments: name: '....' link: '....'
Rejects a Promise in case of invalid link.
Development
npm t
npm run coverage
npm run lint