Factoring in this would be extremely easy but would require API keys for the user.
The easiest way to go about all of this would be to just use the REST API to pull all this information since pleroma and mastodon both can use Mastodon API. However I'm like the only person that hates REST API
The way I'm imagining is more intimate... :cirno_baka: and by intimate I mean some dickhead is literally going to rape/ddos your database and exfiltrate your DMs or something.
You literally just give the application psql access and run tabulations off queries with an internal application and abstract the dangerous functionality away from the end user. It's still extremely dangerous I think somehow if you don't set up your hooks or access controls right.
push button, SELECT id FROM known_users, if match block/mute list remove, count and tally interaction count, sort by id DESC ASEC or something, build visualization.
It'd need to be custom to each instance type because pleroma and mastodon structure data differently and potentially each instance since admins might have setup their databases differently.