1.1.0 • Published 2 years ago

newspk v1.1.0

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

newspk

Description

A basic nodejs based news website (dawn) scraper. You can use this API to fetch latest news in English or Urdu language. It uses node-fetch and jsdom dependencies and hence is a very light-weighted package.

INSTALLATION

You need to install node nodejs and npm package on your machine before using this package.

After installing nodejs and npm, install this package using the command:

npm install newspk

Include this module as:

const newspk = require("newspk");

Basic Usage:

const newspk = require("newspk");

(async () => {
    let limit = 5;              // max-allowed: 15, may return unexpected errors on limit violation
    let lang = "english";       // for english
    // let lang = "urdu";       // for urdu

    let news = await newspk.news(limit, lang);
    console.log(news)           // An array of object with properties "title", "thumbnail", "body", "created_at", "unique id"

})();

ALTERNATIVELY, you can run example.js file.

Feel free to contribute to the repository.

1.1.0

2 years ago

1.0.17

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago