/bggPlays2DB

Saves recorded games from Boardgamegeek in a database. This makes the games easier to evaluate

Primary LanguageJava

Boardgamegeek Plays to Database

Since I log every game on Boardgamegeek, you can generate some interesting statistics from it.

To make it easier for me to generate them, it is easy for me to have the data in a database. There you can use SQL to pull out the interesting statistics.

How to run

A comma-separated list of Boardgamegeek usernames must be passed via the Spring configuration options.

The corresponding property is called bggusernames.

Via the spring.datasource properties can also be used to specify a persistent database.

All further info to start the application could be found in the Spring Documentation.

Example SQLs

select location, count(*) from play where year(play_date) = 2021 group by location order by 2 desc;

select count(*) from play where year(play_date) = 2021;

select distinct gamename from play where year(play_date) = 2021;

select name, count(*) from player join play on player.play_id = play.id where year(play_date) = 2021 and name not in ('Jens', 'Anonymous player') and name not like 'Bot%' group by name order by 2 desc;

select gamename, count(*) from play where year(play_date) = 2021 group by gamename order by 2 desc, gamename;

select gamename, sum(length) from play where year(play_date) = 2021 group by gamename order by 2 desc, gamename;

select gamename, count(*), sum(length) from play where year(play_date) = 2021 group by gamename order by 2 desc, gamename;

select name, gamename, count(*), sum(length) from player join play on player.play_id = play.id where year(play_date) = 2021 and name not in ('Jens', 'Anonymous player') and name not like 'Bot%' group by name, gamename order by name, 4 desc;

😱 No Tests, Dirty code, not following best practices and so on

I am aware that this software is not a masterpiece (in the sense of software craftsmanship).

But it doesn't have to be (yet). If you look at it realistically, I am probably the only user of this software (clearly, because it is also tailored to my needs). And even I will use the software only temporarily.

So why should I invest time in quality? Okay, that sounds like an excuse.... but look at the code: It's really manageable. And even if it is no longer maintainable... who cares? 💔

That's why I rather use the time for my next project ... 😏

But that's not to say that anyone can steer anything to it. On the contrary! Besides, I'm always interested in how to solve things better (even if I know that some things here are quick and especially dirty). So feel free to contact me. 📧