#added a shield for download count for my

1 messages · Page 1 of 1 (latest)

dusky creek
#

cool, how did you do that?

fading heron
lofty summit
# dusky creek cool, how did you do that?

made a GitHub action to scrape mod portal's page every hour, get the download count and save it to a toml file (badge-data.txt in this case)

then i use dynamic toml shields in shields.io to generate the shield element
(i specify the target toml file by using raw github user content)

dusky creek
#

cool :) might steal borrow for my own github pages

lofty summit
runic axle
#

You don't need GitHub actions, you can also do it like this:

[![shield](https://img.shields.io/badge/dynamic/json?color=orange&label=Factorio&query=downloads_count&suffix=%20downloads&url=https%3A%2F%2Fmods.factorio.com%2Fapi%2Fmods%2Fbetter-victory-screen)](https://mods.factorio.com/mod/better-victory-screen)
#

Which also acts as a link to the mod page

#

I shamelessly copied this from people smarter than me 😄

lofty summit
#

wait

#

there is a factorio api?