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

dhn-api

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dhn-api - npm Package Compare versions

Comparing version 1.1.2 to 1.1.3

database/cerpen.json

113

database/news.js

@@ -592,2 +592,110 @@ const axios = require("axios");

/*
* @Viva.id - News
*/
const VIVA_ = async () => {
try {
const res = await axios.request(`https://www.viva.co.id/amp/berita`, {
method: "GET",
headers: {
"User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36"
}
});
let hasil = [];
const $ = cheerio.load(res.data);
$("li > div.al-row").each(function(a, b) {
let berita = $(b).find("a.al-title > h3").text();
let berita_url = $(b).find("a").attr("href");
let berita_thumb = $(b).find(".coverimg").attr("src");
let berita_jenis = $(b).find(".al-cate > h4").text().replace(/[\n|\t| ]/g,"");
let berita_diupload = $(b).find("li").eq(1).text();
const result = {
berita,
berita_url,
berita_thumb,
berita_jenis,
berita_diupload
};
hasil.push(result);
});
var filter = hasil.filter(v => v.berita !== "");
return filter;
} catch (error404) {
return "=> Error => " + error404;
}
}
/*
* @Kontan.id - News
*/
const Kontan_ = async () => {
try {
const res = await axios.request(`https://www.kontan.co.id/`, {
method: "GET",
headers: {
"User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36"
}
});
let hasil = [];
const $ = cheerio.load(res.data);
$("div.news-list > ul > li").each(function(a, b) {
let berita = $(b).find("div.box-news.fleft > a > h1").text();
let berita_url = $(b).find("a").attr("href");
let berita_thumb = $(b).find("div.image-thumb").find("img").attr("data-src");
let berita_jenis = $(b).find("a.link-orange").text();
let berita_diupload = $(b).find("div.box-news.fleft").text().split(/[|]/g).splice(1).join("").slice(1);
const result = {
berita,
berita_url,
berita_thumb,
berita_jenis,
berita_diupload
};
hasil.push(result);
});
var filter = hasil.filter(v => v.berita !== "" && v.berita_diupload !== undefined);
return filter;
} catch (error404) {
return "=> Error => " + error404;
}
}
/*
* @Merdeka - News
*/
const Merdeka_ = async () => {
try {
const res = await axios.request(`https://m.merdeka.com/`, {
method: "GET",
headers: {
"User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36"
}
});
let hasil = [];
const $ = cheerio.load(res.data);
$("li").find("div.mdk-top-stories-item-container").each(function(a, b) {
let berita = $(b).find("img.lazy_loaded").attr("title");
let berita_url = "https://m.merdeka.com" + $(b).find("a").attr("href");
let berita_thumb = $(b).find("img.lazy_loaded").attr("data-src");
let berita_diupload = $(b).find("div.time").text();
const result = {
status: res.status,
creator: "@dehan_j1ng",
berita,
berita_url,
berita_thumb,
berita_diupload
};
hasil.push(result);
});
var filter = hasil.filter(v => v.berita !== "");
return filter;
} catch (error404) {
return "=> Error => " + error404;
}
}
module.exports = {

@@ -610,3 +718,6 @@ metroTV_,

Republika_,
BBC
BBC,
VIVA_,
Kontan_,
Merdeka_
}

@@ -613,0 +724,0 @@

@@ -17,4 +17,2 @@ const axios = require("axios");

return loghandler.noinput;
} else if (emoji.length > 2) {
return "Kebanyakan Dodol :( Minimal 1 Query";
}

@@ -35,5 +33,5 @@ if (emoji.match(_regex)) {

hasil.creator = "@dehan_j1ng";
hasil.unicode_name = $("section").eq(3).find("p").text();
hasil.unicode_alias = $(".aliases").find("ul > li").text().split(emoji).join(" - " + emoji);
hasil.unicode_desc = $(".description").find("p").text();
hasil.unicode_name = $("section").eq(3).find("p").text().trim();
hasil.unicode_alias = $(".aliases").find("ul > li").text().trim().split(emoji).join(" - " + emoji);
hasil.unicode_desc = $(".description").find("p").text().trim();
hasil.unicode_pack = [];

@@ -67,4 +65,32 @@ $(".vendor-list > ul > li").each(function (a, b) {

/*
* @Info Corona
*/
const Corona_ = async (country) => {
if (!country) return loghandler.noinput;
try {
const res = await axios.request(`https://www.worldometers.info/coronavirus/country/` + country, {
method: "GET",
headers: {
"User-Agent": "Mozilla/5.0 (Linux; Android 9; Redmi 7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.77 Mobile Safari/537.36"
}
});
let result = {};
const $ = cheerio.load(res.data);
result.negara = $("div").find("h1").text().slice(3).split(/ /g)[0];
result.total_kasus = $("div#maincounter-wrap").find("div.maincounter-number > span").eq(0).text() + " total";
result.total_kematian = $("div#maincounter-wrap").find("div.maincounter-number > span").eq(1).text() + " total";
result.total_sembuh = $("div#maincounter-wrap").find("div.maincounter-number > span").eq(2).text() + " total";
result.informasi = $("div.content-inner > div").eq(1).text();
result.informasi_lengkap = "https://www.worldometers.info/coronavirus/country/" + country;
return result;
} catch (error404) {
return "=> Error => " + error404;
}
};
module.exports = {
Emojing_
Emojing_,
Corona_
};

@@ -71,0 +97,0 @@

@@ -5,2 +5,3 @@ const news = require("./database/news.js");

const other = require("./database/other.js");
const json = require("./database/json.js");

@@ -24,2 +25,5 @@ exports.BBCNews = news.BBC;

exports.RepublikaNews = news.Republika_;
exports.VivaNews = news.VIVA_;
exports.KontanNews = news.Kontan_;
exports.MerdekaNews = news.Merdeka_;
exports.KomikuSearch = anime.Komiku_;

@@ -38,2 +42,8 @@ exports.AniPlanetSearch = anime.AnimePlanet_;

exports.WAModsSearch = search.WAMods;
exports.Emojis = other.Emojing_;
exports.Emojis = other.Emojing_;
exports.CoronaInfo = other.Corona_;
exports.Cerpen = json.Cerpen_;
exports.Quotes = json.Quotes_;
exports.Couples = json.Couples;
exports.JalanTikusMeme = json.JTMimers;
exports.Darkjokes = json.Dark;

5

package.json
{
"name": "dhn-api",
"version": "1.1.2",
"version": "1.1.3",
"description": "An Example Api's",

@@ -21,4 +21,5 @@ "main": "index.js",

"axios": "^0.21.1",
"cheerio": "^1.0.0-rc.10"
"cheerio": "^1.0.0-rc.10",
"path": "^0.12.7"
}
}

@@ -10,2 +10,12 @@ # Installing

### De-BOTZ Example Case For dhn-api
| Link | Thank You >\/\/< |
|------|------------------|
|[HERE](https://dehan-j1ng/De-BOTZ)| De-BOTZ |
|[HERE](https://dhn-api.herokuapp.com/api)| Dhn-Api Rest |
**Bakaaa Onichann >\/\/<**
## Usages

@@ -75,2 +85,5 @@

RepublikaNews: [AsyncFunction: Republika_],
VivaNews: [AsyncFunction: VIVA_],
KontanNews: [AsyncFunction: Kontan_],
MerdekaNews: [AsyncFunction: Merdeka_],
KomikuSearch: [AsyncFunction: Komiku_],

@@ -89,3 +102,9 @@ AniPlanetSearch: [AsyncFunction: AnimePlanet_],

WAModsSearch: [AsyncFunction: WAMods],
Emojis: [AsyncFunction: Emojing_]
Emojis: [AsyncFunction: Emojing_],
CoronaInfo: [AsyncFunction: Corona_],
Cerpen: [Function: Cerpen_],
Quotes: [Function: Quotes_],
Couples: [Function: Couples],
JalanTikusMeme: [Function: JTMimers],
Darkjokes: [Function: Dark]
}

@@ -130,2 +149,5 @@ ```

| 17 | Antara News |
| 18 | Viva News |
| 19 | Kontan News |
| 20 | Merdeka News |
<br>

@@ -147,5 +169,16 @@

| 1 | Emoji to Png |
| 2 | Corona Info |
<br>
### Thanks you for installing this packages >\\\<
| List | Name |
|------|------|
| Type | Random |
| 1 | Quotes Random |
| 2 | Cerpen Random |
| 3 | Darkjokes Random |
| 4 | Couples Wallpaper Random |
| 5 | Jalantikus Meme Random |
### Thanks you for installing this packages >\/\/\/<
baakaaaaa !1!1!1!1!!!! :3
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