Finished fixing the web-scraper for Heroku

This commit is contained in:
ION606
2022-04-30 21:45:03 -04:00
parent 10adef1160
commit bd80c42bed
3 changed files with 24 additions and 4 deletions
+6 -4
View File
@@ -1,17 +1,19 @@
const hastebin = require("hastebin-gen");
module.exports ={
name: "scraper",
description: ".....",
execute(message, args) {
async execute(message, args) {
const axios = require('axios');
const cheerio = require('cheerio')
const url = args[0];
axios(url)
.then(response => {
.then(async response => {
const html = response.data;
const $ = cheerio.load(html);
//lyrics = $('.para_row').text();
message.channel.send(html);
const haste = await hastebin(html, { extension: "txt" });
message.channel.send(haste);
// console.log(lyrics);
})
.catch(console.error);
+17
View File
@@ -17,6 +17,7 @@
"discord.js": "^13.6.0",
"ffmpeg": "^0.0.4",
"ffmpeg-static": "^5.0.0",
"hastebin-gen": "^2.0.5",
"libsodium-wrappers": "^0.7.10",
"node.js": "^0.0.1-security",
"play-dl": "^1.9.4",
@@ -924,6 +925,14 @@
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk="
},
"node_modules/hastebin-gen": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/hastebin-gen/-/hastebin-gen-2.0.5.tgz",
"integrity": "sha512-At1LaKtcqh2jiP8xfE2sDGT9IshIki6FqsgLwn2y7FzAvlFJRtpUsSPh3yWjWIQIvxi/GPF07IBqSI8WhPL/gQ==",
"dependencies": {
"node-fetch": "^2.6.0"
}
},
"node_modules/htmlparser2": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz",
@@ -2925,6 +2934,14 @@
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk="
},
"hastebin-gen": {
"version": "2.0.5",
"resolved": "https://registry.npmjs.org/hastebin-gen/-/hastebin-gen-2.0.5.tgz",
"integrity": "sha512-At1LaKtcqh2jiP8xfE2sDGT9IshIki6FqsgLwn2y7FzAvlFJRtpUsSPh3yWjWIQIvxi/GPF07IBqSI8WhPL/gQ==",
"requires": {
"node-fetch": "^2.6.0"
}
},
"htmlparser2": {
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz",
+1
View File
@@ -8,6 +8,7 @@
"discord.js": "^13.6.0",
"ffmpeg": "^0.0.4",
"ffmpeg-static": "^5.0.0",
"hastebin-gen": "^2.0.5",
"libsodium-wrappers": "^0.7.10",
"node.js": "^0.0.1-security",
"play-dl": "^1.9.4",