Terminal / Discord_Fork

An open source Discord Bot List made with GatsbyJS
https://ls.terminal.ink/
MIT License
63 stars 73 forks source link

API endpoint to get individual bot #63

Closed MattIPv4 closed 6 years ago

MattIPv4 commented 6 years ago

It would be nice if there was an endpoint similar to api/bots/all.json but for each individual bot. Eg. api/bots/:id.json

Thanks.

7coil commented 6 years ago

Other than raising ls.terminal.ink out from the grave, I don't have a good way of getting Jekyll to do this. I could get Node.js to split the files, but it diverges from the "Use Jekyll only" philosophy...

But at this point, I might as well.

MattIPv4 commented 6 years ago

Node is an option, as discussed in Discord, it might be possible to populate the api/bots directory with the bot json files during the build process which would allow the whole Jekyll only mantra to stay.

7coil commented 6 years ago

Might also use Discord_Fork as a way to add projects, for a real backend that does everything

7coil commented 6 years ago

I'm currently attempting to attack this using Jekyll itself, by using Ruby plugins

love4eva

7coil commented 6 years ago

im kinda retarded at jekyll's ruby tho, so please excuse the crud

7coil commented 6 years ago

I've got some output!

{
  "draft": false,
  "categories": [

  ],
  "layout": "item",
  "type": "bots",
  "lang": "en",
  "primary_key": "client_id",
  "client_id": "134133271750639616",
  "application_id": "170237838334492682",
  "pagename": "blargbot",
  "description": "A multipurpose discord bot - Moderation and Fun!",
  "avatar": "https://cdn.discordapp.com/avatars/134133271750639616/1a7e28c9bf7a69475b7928226ca70a40.png",
  "link": "https://invite.blargbot.xyz",
  "prefix": "b!",
  "title": "134133271750639616",
  "slug": "134133271750639616",
  "ext": ".md",
  "tags": [

  ],
  "excerpt": "<iframe src=\"https://blargbot.xyz/\" class=\"ls-iframe\">\n<!--\nThis data was imported from ls.terminal.ink\n-->\n</iframe>\n",
  "permalink": "/bots/134133271750639616/"
}
7coil commented 6 years ago

There is a test environment in PR #76. Preview this here

keys.json all.json wendesday's .json file

MattIPv4 commented 6 years ago

Looks pretty sweet. Is there any reason that the invite is called link and not invite?

7coil commented 6 years ago

It's an agnostic term which applies to both bots and servers

MattIPv4 commented 6 years ago

Invite would also work for both 🤔 and is probably more descriptive

7coil commented 6 years ago

It's also the term that's already in all .yml files

MattIPv4 commented 6 years ago

Ah okay fair enough then. Other than that, looks absolutely great.