1.0.7 • Published 7 years ago

tneu-news-parser v1.0.7

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

TNEU News Parser

Parse news articles at tneu.edu.ua

npm Build Status Coverage Status

Install

Ensure you have Node.js version 4 or higher installed. Then run the following:

$ yarn add tneu-news-parser

Usage

const got = require('got');
const NewsParser = require('tneu-news-parser');

// Parse article snippets
got('http://www.tneu.edu.ua/news/page/1')
  .then(response => {
    return NewsParser.parseArticleSnippets(response.body);
  })
  .then(articleSnippets => {
    /*
      [
        {
          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....'
        }
      ]
    */
  });

// Parse a particular article
got('http://www.tneu.edu.ua/news/9671-naukovo-praktychne-zabezpechennia.html')
  .then(response => {
    return NewsParser.parseArticle(response.body);
  })
  .then(article => {
    /*
      {
          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: '....' }]
      }
    */
  });

Development

  • npm t
  • npm run coverage
  • npm run lint
1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago