Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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', 'witter.cz', 'cztwitter.cz', 'f.cz', 'mastodon.pirati.cz', 'mastodon.arch-linux.cz', 'mamutovo.cz', 'mastodon.cesko.digital')
- total = 0
- fsechno = [chobot.nasaj(domena) for domena in domeny]
- for j in sorted(fsechno, key = lambda k: int(k['usage']['users']['active_month']), reverse=True):
- 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))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement