npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@sl-code-lords/esana-news

v1.1.0

Published

unofficial scrap for esana

Downloads

6,922

Readme

Status GitHub Issues GitHub Pull Requests License


📝 Table of Contents

🧐 About

The unofficial Scrap [Esana]

🏁 Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Installing

yarn add @sl-code-lords/esana-news

or

npm i @sl-code-lords/esana-news

🎈 Usage

const Esana = require('@sl-code-lords/esana-news')

var api = new Esana()

get news

await api.news('98691')
{
  news_url: 'https://www.helakuru.lk/esana/98967',
  news_id: 98967,
  TITLE: 'ශ්‍රී ලංකා රුපියල ආසියාවේ දුර්වලතම මුදල් ඒකකය බවට පත් වී ඇති බව Bloomberg වාර්තා කරයි',
  DESCRIPTION: ' ',
  COVER: 'https://helakuru.sgp1.cdn.digitaloceanspaces.com/esana/images/lib/dollar-rupee.jpg',
  URL: 'https://www.helakuru.lk/esana/98967',
  PUBLISHED: '2023-07-25 19:16:49',
  sub_img: [],
  full_news: 'මේ වසරේ මුල් භාගය තුළ ආසියාවේ හොඳම ක්‍රියාකාරීම මුදල් ඒකකය බවට පත්වූ ශ්‍රී ලංකා රුපියල, මේ වන විට ආසියාවේ දුර්වලතම මුදල් ඒකකය බවට පවත්ව ඇති බව Bloomberg වෙබ් අඩවිය වාර්තා කර තිබෙනවා.\n' +
    '\n' +
    'ඒ අනුව එම වෙබ් අඩවිය පෙන්වා දෙන්නේ අඛණ්ඩව දින 14 ක කාලයක් තුළ රුපියල 6% කින් අවප්‍රමාණයවී ඇති බවයි.\n' +
    '\n' +
    'පොලී අනුපාත කප්පාදුව සහ ආනයන පාලනයන් ලිහිල් කිරීම හේතුවෙන් තවදුරටත් රුපියල අවප්‍රමාණය විය හැකි බවත් වසර අවසානය වන විට ඩොලරය රුපියල් 355 ක් දක්වා ඉහළ යනු ඇති බවත් එම වෙබ් අඩවිය වැඩිදුරටත් සඳහන් කර තිබෙනවා.'
}

get latest news id

await api.latest_id()
{
  code: 200,
  code_creator: { name: 'Ravindu_Manoj', github: '@ravindu01manoj' },
  results: {
    latest_news_url: 'https://www.helakuru.lk/esana/98691',
    news_id: 98691
  }
}

get news Comments

await api.comments('98691')
{
  code: 200,
  code_creator: { name: 'Ravindu_Manoj', github: '@ravindu01manoj' },
  results: [
    {
      comment_id: '5070483',
      name: 'Tharani De Silva',
      comment: 'අපේ කකුල් කඩලා රෝද පුටුවක් දුන්නා කියලා උඹලට ආයේ රැවටෙන්නේ නෑ',
      ago: '30m Ago',
      img: 'https://esana.helakuru.lk/p/g/59255a58332310011e17a4ba9b16ec53.png'
    },
    {
      comment_id: '5070482',
      name: 'Indhunil Gamage',
      comment: 'නිකමිි දුන්නත් × වානා',
      ago: '35m Ago',
      img: 'https://esana.helakuru.lk/p/g/5e2bef68694fd3592fd3dc0eda4be484.png'
    },
    {
      comment_id: '5070481',
      name: 'Ravee Kumara',
      comment: 'hodai',
      ago: '46m Ago',
      img: 'https://esana.helakuru.lk/p/g/53dcda3cecd5495051accd2ddd89249c.png'
    },
    {
      comment_id: '5070479',
      name: 'Gaminda Tennakoon',
      comment: 'සතුටින් හිටප්ස්ල්ලා,EPF එකට කෙලවෙනකං...',
      ago: '56m Ago',
      img: 'https://esana.helakuru.lk/p/g/ceb401a4f5217e836b886c92e19e100b.png'
    },
    ... 283 more items
  ]
}

get news list

await api.list()
{
  code: 200,
  code_creator: { name: 'Ravindu_Manoj', github: '@ravindu01manoj' },
  results: [
    {
      id: '98691',
      title: 'ලිට්‍රෝ ගෑස් මිල හෙට සිට අඩු වෙයි‍',
      thumb: 'https://helakuru.sgp1.cdn.digitaloceanspaces.com/esana/images/lib/litro-gas[1].jpg'
    },
    {
      id: '98690',
      title: 'පෞද්ගලික විශ්ව විද්‍යාලවල අධ්‍යාපනය හැදැරීමට පොලී රහිත ණය සඳහා අයදුම් කිරීම හෙට ආරම්භ වෙයි',
      thumb: 'https://helakuru.sgp1.cdn.digitaloceanspaces.com/esana/images/lib/exam-re.jpg'
    },
    {
      id: '98689',
      title: 'මේ වසරේ ඩෙංගු වැළඳීමෙන් පුද්ගලයින් 31 ක් මරුට',
      thumb: 'https://helakuru.sgp1.cdn.digitaloceanspaces.com/esana/images/lib/dengue[1].jpg'
    },
    {
      id: '98687',
      title: 'අධි ඇසළ පොහොය අදයි',
      thumb: 'https://helakuru.sgp1.cdn.digitaloceanspaces.com/esana/images/lib/poya[1].jpg'
    },
    {
      id: '98688',
      title: 'දේශීය ණය ප්‍රතිව්‍යුහගතකරණයට පසුබිම සකස් කිරීම සඳහා දේශීය ආදායම් බදු පනත සංශෝධනය කරන්න වෙනවා - මුදල් රාජ්‍ය අමාත්‍ය',
      thumb: 'https://helakuru.sgp1.cdn.digitaloceanspaces.com/esana/images/lib/ranjith-siyabalapitiya-new[1].jpg'
    },
    ... 33 more items
  ]
}

Loop For New News

var callback = async (full_news) => {
  console.log(full_news)
}
var ms = 60*1000 // 60 seconds
await api.news_loop(callback,ms)

Clear Loop

await api.clear_loop()

✍️ Authors

See also the list of contributors who participated in this project.