Created
February 13, 2018 23:36
-
-
Save itslukej/4d18750735a67a46ed60891d59a8a822 to your computer and use it in GitHub Desktop.
A script to grab all bots from discordbots.org
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const superagent = require('superagent'); | |
const bots = []; | |
(async () => { | |
for(let off = 0; off < 100; off++) { | |
const r = await superagent.get(`https://discordbots.org/api/bots?offset=${off*50}&limit=50`); | |
// Sort through bots | |
for(let botScraped of r.body.results) { | |
const bot = { | |
discord_id: botScraped.id, | |
name: botScraped.username, | |
invite: botScraped.invite, | |
short_desc: botScraped.shortdesc, | |
support_invite: botScraped.website.includes('discord.gg') ? botScraped.website : null, | |
prefix: botScraped.prefix | |
}; | |
bots.push(bot); | |
} | |
} | |
console.log(JSON.stringify(bots, null, 4)); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment