#!/usr/bin/python3
import chobot
fmt = '|%24s |%8s |%8s |%9s |%9s |%10s |%9s |%8s |%9s |%9s |'
print (fmt % ('Domain','Version','Monthly','Max.char', 'Max.poll', 'Translate', 'New user', 'Approve', 'Image MB', 'Video MB'))
domeny = ('mastodonczech.cz', 'mastodon.arch-linux.cz', 'witter.cz', 'cztwitter.cz', 'f.cz', 'mastodon.pirati.cz', 'mamutovo.cz', 'mastodon.cesko.digital')
total = 0
for domena in domeny:
j = chobot.nasaj(domena)
c = j['configuration']
u = j['usage']['users']['active_month']
total += int(u)
print(fmt % (j['domain'], j['version'], u, c['statuses']['max_characters'], c['polls']['max_options'],
c['translation']['enabled'], j['registrations']['enabled'], j['registrations']['approval_required'],
int(c['media_attachments']['image_size_limit'] >> 10), int(c['media_attachments']['video_size_limit'] >> 10)))
print('|%24s |%8s |%8s |' % ('Total', '', total))