mirror of
https://github.com/ION606/selmerBot.git
synced 2026-05-15 05:36:54 +00:00
Finished fixing the web-scraper for Heroku
This commit is contained in:
+6
-4
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user