@dark-yasiya/news-scrap
v2.0.1
Published
<p align="center"> <a href="" rel="noopener"> <img width=200px height=200px src="https://cdn.pixabay.com/photo/2017/06/26/19/03/news-2444778_1280.jpg" alt="News"> </a> </p>
Readme
📑 Table of Contents
✨ About
Unofficial Node.js scrapers for multiple Sri Lankan & International news websites.
This package allows you to fetch the latest headlines, descriptions, dates, and images from trusted news portals with a single line of code.
⚡ Getting Started
Clone or install this package and start scraping news instantly.
📦 Installation
# Using Yarn
yarn add @dark-yasiya/news-scrap
# Using NPM
npm i @dark-yasiya/news-scrap
const DY_NEWS = require('@dark-yasiya/news-scrap');
const news = new DY_NEWS();
🍟 Usage
const DY_NEWS = require('@dark-yasiya/news-scrap');
const news = new DY_NEWS();
(async () => {
try {
const ada = await news.ada();
console.log(ada);
} catch (error) {
console.error("Error fetching news:", error);
}
})();
// 🔹 Example Result
/*
{
"status": true,
"creator": "@DarkYasiya",
"result": {
"title": "පූජිතට දිට්ඨ ධම්මවේදනීය කර්මය ඵල දීලා-පියල් නිශාන්ත",
"date": "July 4, 2019",
"time": "07:11 pm",
"image": "https://s3.amazonaws.com/adaderanasinhala/1562248457-piyal_l.jpg",
"url": "https://sinhala.adaderana.lk/news/113386",
"desc": "අනිවාර්ය නිවාඩු යැවු පොලිස්පති පූජිත් ජයසුන්දර මහතාට දිට්ඨධම්මවේදනීය කර්මයක් විපාක දී ඇති බව එක්සත් ජනතා නිදහස් සන්ධාන පාර්ලිමේන්තු මන්ත්රී පියල් නිශාන්ත මහතා ප්රකාශ කරයි.\n\nඅද ශ්රී ලංකා පොදුජන පෙරමුණ කැඳවු මාධ්ය හමුවකට එක්වෙමින් මන්ත්රීවරයා මේ බව සඳහන් කළා.\n\n\"පූජිත පොලිස්පතිවරයා ලෙස වැඩ භාර ගනිද්දී රාජපක්ෂවරුන්ට ජම්පර් අන්දවන්න සූදානම් වුණේ.\n\nපූජිතට හෙට අනිද්දා වෙනකොට ජම්පරය අඳින්න වෙනවා.\"\n\nගෝඨාභය රාජපක්ෂ මහතාගේ අමෙරිකානු පුරවැසිභාවය අහෝසි කිරීම පිළිබඳ සියලු කරුණු නිරාකරණය වී ඇති බව මෙම අවස්ථාවේ අදහස් දැක්වු රමේෂ්පතිරණ මහතා ප්රකාශ කළේය."
}
}
*/📰 Supported Sources
| Source | Function |
|-----------------|---------------------------|
| Ada.lk | await news.ada() |
| BBC.com | await news.bbc() |
| Dailymirror.lk | await news.dailymirror()|
| Lankadeepa.lk| await news.lankadeepa() |
| Newswire.lk | await news.newswire() |
| Sirasa | await news.sirasa() |
| HiruNews.lk | await news.hiru() |
| AdaDerana.lk | await news.derana() |
| Esana.lk| await news.esana() |
| Itn.lk| await news.itn() |
🖋 Author
- @DarkYasiya - scraped author
