esana-node-api
Advanced tools
Comparing version 2.0.4 to 2.0.5
{ | ||
"name": "esana-node-api", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "Esana News || Helakuru.lk - එසැණ News", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
110
readme.md
<img align="center" src="https://www.helakuru.lk/assets/images/icon.png" height="100px" width="100px"> | ||
<h1 align="center"><b> Helakuru.lk | | එසැණ </b></h1> | ||
<h3 align="center"><b>⭕️ API (Unofficial) ⭕️<br><br> SISULA WELGAMAGE | | RAVINDU MANOJ</b></h3><br> | ||
<h3 align="center"><b>⭕️ API (Unofficial) ⭕️<br><br> <a href="https://sisula.ml/" target="_blank">SISULA WELGAMAGE</a> | | <a href="https://ravindu01manoj.ml/" target="_blank">RAVINDU MANOJ</a></b></h3><br> | ||
@@ -23,17 +23,22 @@ `⭕️ This project is for educational purposes only!⭕️ ` <br> | ||
- [x] <b> නවතම එසැණ News ලබා ගැනීමට { fetch: 'latest' } භාවිතා කරන්න... මෙය ස්වයංක්රීයව යාවත්කාලීන වීම සිදුවේ. </b> | ||
- [x] <b> පැරණි එසැණ News සියල්ල ලබා ගැනීමට { fetch: 'all' } භාවිතා කරන්න... ⭕️ temporarily removed ⭕️ </b> | ||
- [x] <b> </b> | ||
<br> | ||
## Usage - Latest News Esana / නවතම එසැණ News ලබා ගැනීමට. | ||
## Usage - Fetch Latest News Esana / එසැණ News ලබා ගැනීමට. | ||
```js | ||
const {esana_scrape, esana_latest_news_id, esana_scrape_from_id} = require("esana-node-api").esana_news; | ||
const {Esana} = require("esana-node-api") | ||
//scrape latest news | ||
async function esana_run(){ | ||
const latest_news = await esana_scrape({ fetch: 'latest' , passcode: 'your_passcode'}) // Enter Your Passcode or Contact Admin (+94766239744) | ||
console.log(latest_news) | ||
const esana = new Esana() | ||
await esana.verify('Enter Your Passcode') | ||
const esana_data = await esana.esana_latest() | ||
console.log(esana_data) | ||
} | ||
esana_run() | ||
``` | ||
Output: | ||
@@ -67,91 +72,2 @@ | ||
## Usage - Fetch All News Esana / එසැණ News සියල්ල ලබා ගැනීමට. | ||
```js | ||
const {esana_scrape, esana_latest_news_id, esana_scrape_from_id} = require("esana-node-api").esana_news; | ||
//scrape all esana news | ||
const all_news = await esana_scrape({ fetch: 'all' , passcode: 'your_passcode'}) // Enter Your Passcode or Contact Admin (+94766239744) | ||
console.log(latest_news) | ||
``` | ||
Output: | ||
```js | ||
[ | ||
{ | ||
id: '93795', | ||
title: 'මුදල් රාජ්ය ඇමති සහ IMF නියෝජ්ය කළමනාකාර අධ්යක්ෂ අතර හමුවක්', | ||
thumb: 'https://news.bhashalanka.com/image-library/shehan-okamura.jpg' | ||
}, | ||
{ | ||
id: '93794', | ||
title: 'නාවලපිටියේ පොහොට්ටුවේ රැළියක් අතරතුර ඊට විරෝධතාවය දැක්වූ පිරිසක් අත්අඩංගුවට', | ||
thumb: 'https://news.bhashalanka.com/image-library/nawalapitiya-protest.jpg' | ||
}, | ||
{ | ||
id: '93790', | ||
title: 'නැමීබියාවට ලකුණු 55 ක ජයක්', | ||
thumb: 'https://news.bhashalanka.com/image-library/sl-vs-nambia.jpg' | ||
}, | ||
{ | ||
id: '93786', | ||
title: 'ශ්රී ලංකාවට ලකුණු 164 ක ඉලක්කයක්', | ||
thumb: 'https://news.bhashalanka.com/image-library/sl-vs-nambia.jpg' | ||
}, | ||
{ | ||
id: '93785', | ||
title: 'අයහපත් කාලගුණයෙන් පුද්ගලයින් 55,000 ක් පමණ පීඩාවට පත්වෙයි', | ||
thumb: 'https://news.bhashalanka.com/image-library/kelani-river-flood.jpg' | ||
}, | ||
{ | ||
id: '93784', | ||
title: 'කාසියේ වාසිය ශ්රී ලංකාවට', | ||
thumb: 'https://news.bhashalanka.com/image-library/sl-vs-nambia.jpg' | ||
}, | ||
{ | ||
id: '93782', | ||
title: 'T20 ලෝක කුසලානය අරඹමින් ශ්රී ලංකාව සහ නැමීබියාව අද තරඟ බිමට', | ||
thumb: 'https://news.bhashalanka.com/image-library/sl-vs-nambia.jpg' | ||
} | ||
] | ||
``` | ||
## Usage - Fetch Esana News Using News Id / එසැණ News Id ඇතුළත් කර විස්තර ලබා ගැනීමට. | ||
```js | ||
const {esana_scrape, esana_latest_news_id, esana_scrape_from_id} = require("esana-node-api").esana_news; | ||
//scrape Esana news Using News Id | ||
const latest_news = await esana_scrape_from_id( { id: news_id , passcode: 'your_passcode'}} ) // example {id: '93782'} | ||
console.log(latest_news) | ||
``` | ||
Output: | ||
```js | ||
{ | ||
news_from_id: { | ||
helakuru: { | ||
news_id: '93782', | ||
title: 'T20 ලෝක කුසලානය අරඹමින් ශ්රී ලංකාව සහ නැමීබියාව අද තරඟ බිමට', | ||
description: '2022 පන්දුවාර විස්සයි විස්ස ලෝක කුසලාන ක්රිකට් තරඟාවලිය අද (16) ඔස්ට්රේලියාවේ දී ආරම්භ වනවා.\n' + | ||
'\n' + | ||
'ඒ අනුව ශ්රී ලංකාව සහ නැමීබියාවට අතර තරඟය පෙරවරු 9.30 ට ජීලෝන්ග් හී දී ආරම්භ වීමට නියමිතයි.\n' + | ||
'\n' + | ||
'තරඟයේ සජීවී තොරතුරු එසැණ හරහා ඔබවෙත ගෙන ඒමට මේ වන විටත් සියලුම කටයුතු සූදානම් කර තිබෙනවා.', | ||
thumb: 'https://news.bhashalanka.com/image-library/sl-vs-nambia.jpg', | ||
url: 'https://www.helakuru.lk/esana/news/93782', | ||
data: '2022-10-16 06:57:31', | ||
lang: 'Sinhala' | ||
media: ['http://example.jpg', 'http://example2.jpg', 'http://example3.jpg']] | ||
//If Media Empty | ||
media: [{status: false}] | ||
} | ||
} | ||
} | ||
``` | ||
## License | ||
@@ -158,0 +74,0 @@ |
210034
77