Skip to content

Instantly share code, notes, and snippets.

@technorav3nn
Created January 1, 2024 01:28
Show Gist options
  • Select an option

  • Save technorav3nn/a5830fed5eed3dd0db0d8e31d2dd9e84 to your computer and use it in GitHub Desktop.

Select an option

Save technorav3nn/a5830fed5eed3dd0db0d8e31d2dd9e84 to your computer and use it in GitHub Desktop.
Download clash of clans troop images
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