Created
January 1, 2024 01:28
-
-
Save technorav3nn/a5830fed5eed3dd0db0d8e31d2dd9e84 to your computer and use it in GitHub Desktop.
Download clash of clans troop images
This file contains hidden or 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
| import { Wiki } from "@quority/fandom"; | |
| import wtf from "wtf_wikipedia"; | |
| function getUrl(name: string) { | |
| return `https://clashofclans.fandom.com/wiki/Special:Redirect/file/${name.replace("File:", "")}`; | |
| } | |
| const wiki = new Wiki({ | |
| api: "clash-of-clans", | |
| }); | |
| const dragonWikiText = await wiki.getPage("Dragon"); | |
| const dragon = wtf(dragonWikiText); | |
| console.log(getUrl(dragon.image()!.file())); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment