Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dhnapi/news-api

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dhnapi/news-api - npm Package Compare versions

Comparing version 1.0.0--beta-v to 1.0.10--up-v

LICENSE

2

package.json
{
"name": "@dhnapi/news-api",
"version": "1.0.0--beta-v",
"version": "1.0.10--up-v",
"description": "Simple News-API scrapper library",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -6,2 +6,3 @@ ## News-API

@@ Created on 1-12-21 | Dehanjing @@
+ Updated on 3-12-21 | Dehanjing
```

@@ -27,7 +28,16 @@

|----|------|-------------|
| 1 | CNN | Get news on [CNN ID](https://www.cnnindonesia.com/) |
| 2 | BBC | Get news on [BBC ID](https://www.bbc.com/indonesia) |
| 1 | Antara | Get news on [Antara](https://m.antaranews.com/terkini) |
| 2 | BBC | Get news on [BBC](https://www.bbc.com/indonesia) |
| 3 | CNBC | Get news on [CNBC](https://www.cnbcindonesia.com/news/) |
| 4 | CNN | Get news on [CNN](https://www.cnnindonesia.com/) |
| 5 | Daily | Get news on [Daily](https://www.dailynewsindonesia.com/rubrik/news/) |
| 6 | Detik | Get news on [Detik](https://www.detik.com/terpopuler/) |
| 7 | Fajar | Get news on [Fajar](https://fajar.co.id/category/nasional/) |
| 8 | IDN | Get news on [IDN](https://www.idntimes.com/news/) |
| 9 | Indozone | Get news on [Indozone](https://www.indozone.id/index/) |
| 10 | INews | Get news on [INews](https://www.inews.id/news/) |
| 11 | Kompas | Get news on [Kompas](https://news.kompas.com/) |
| 12 | Kontan | Get news on [Kontan](https://www.kontan.co.id/) |
## Examples
## Example

@@ -39,2 +49,5 @@ ```javascript

// @return {Object} class
// console.log(dapi);
/**

@@ -51,3 +64,3 @@ *

/**
* @return response {Object}
* @return {Object} response
* @object AxiosResponse

@@ -66,2 +79,4 @@ **/

- please add issue if you having problem with installation
! github: https://github.com/Dehanjing/news-api
```
const fs = require("fs");
let __dir = process.cwd();
let path = require("path");

@@ -21,3 +21,3 @@ class NewsApi {

};
fs.readdirSync("./src/lib/").forEach((plugins) => {
fs.readdirSync(__dirname + "/lib/").forEach((plugins) => {
let plugins_ = require("./lib/" + plugins);

@@ -24,0 +24,0 @@ this[plugins.split(".js").shift()] = plugins_;

@@ -9,5 +9,5 @@ module.exports = function(fn) {

hasil.push({
berita: $(this).find("p").text().trim(),
berita_url: "https://www.bbc.com" + $(this).find("a").attr("href"),
berita_diupload: $(this).find("time").text().trim(),
title: $(this).find("p").text().trim(),
news_url: "https://www.bbc.com" + $(this).find("a").attr("href"),
upload_date: $(this).find("time").text().trim(),
});

@@ -18,4 +18,4 @@ });

result: hasil.filter(({
berita, berita_diupload
}) => (berita && berita_diupload))
title, upload_date
}) => (title && upload_date))
};

@@ -22,0 +22,0 @@ fn(response, null);

@@ -9,6 +9,6 @@ module.exports = function(fn) {

hasil.push({
berita: $(this).find('h4').text().trim(),
berita_url: $(this).find('a').attr('href'),
berita_diupload: $(this).find('span.date').text().trim(),
berita_thumb: $(this).find('img').attr('src'),
title: $(this).find('h4').text().trim(),
news_url: $(this).find('a').attr('href'),
upload_date: $(this).find('span.date').text().trim(),
thumbnail: $(this).find('img').attr('src'),
});

@@ -19,4 +19,4 @@ });

result: hasil.filter(({
berita, berita_diupload
}) => (berita && berita_diupload))
title, upload_date
}) => (title && upload_date))
};

@@ -23,0 +23,0 @@ fn(response, null);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc