Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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.

License

Notifications You must be signed in to change notification settings

MazanLabeeb/newspk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NewsPK - Pakistan News Scraper

A lightweight TypeScript-based Node.js library for fetching the latest news articles from Pakistani news sources (Dawn News). Supports both English and Urdu languages.

Installation

npm install newspk

Quick Start

import { news } from 'newspk';

const articles = await news(5, 'english');
console.log(articles);

Build & Run

Build the library and run examples:

npm install
npm run build      # Compile TypeScript
npm run dev        # Watch mode (development)
npm run clean      # Remove build output

Run the example (uses ts-node):

npm run example

API Reference

news(limit?: number, lang?: Language): Promise<NewsArticle[]>

Fetches latest news articles from Dawn News.

Parameters:

  • limit (number, default: 5) - Number of articles to fetch (max: 15)
  • lang (string, default: 'urdu') - Language: 'english' or 'urdu'

Returns: Array of NewsArticle objects

License

MIT - See LICENSE file

Made by Mazan Labeeb

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •