updated README and small changes in day overview

This commit is contained in:
Frisk 2018-06-22 19:25:47 +02:00
parent cca18a0052
commit 318c5bf04c
No known key found for this signature in database
GPG key ID: 0E9A7D3C0A01586C
2 changed files with 4 additions and 3 deletions

View file

@ -12,14 +12,15 @@ Recent changes Gamepedia compatible Discord webhook is a project made from earli
* Fetch recent changes from Gamepedia wiki and send them to Discord channel using a webhook * Fetch recent changes from Gamepedia wiki and send them to Discord channel using a webhook
* Send day overview, that lists how active was the wiki this day * Send day overview, that lists how active was the wiki this day
* Can support multiple languages * Can support multiple languages
* Re-sends edits after down-time
### settings.json ### ### settings.json ###
Explanation for settings: Explanation for settings:
`cooldown` interval for how often changes are retrieved from the wiki (due to used solutions, the real interval is ~1 sec longer) `cooldown` interval for how often changes are retrieved from the wiki (due to used solutions, the real interval is ~1 sec longer)
`wiki` wiki prefix the bot is supposed to work with (for example, for English Minecraft Wiki it's minecraft (https://**minecraft**.gamepedia.com) and for Polish Minecraft Wiki minecraft-pl (https://**minecraft-pl**.gamepedia.com `wiki` wiki prefix the bot is supposed to work with (for example, for English Minecraft Wiki it's minecraft (https://**minecraft**.gamepedia.com) and for Polish Minecraft Wiki minecraft-pl (https://**minecraft-pl**.gamepedia.com
`lang` language for the messages, currently available options are: de, en, pl `lang` language for the messages, currently available options are: de, en, fr, pl
`header` it's recommended to leave this value as it is, it's a header the script will use to communicate with Gamepedia. Please note that without it, no communication will be possible. `header` it's recommended to leave this value as it is, it's a header the script will use to communicate with Gamepedia. Please note that without it, no communication will be possible.
`limit` amount of actions retrieved every `cooldown` amount of seconds. The higher it is the more network data will be used and the data will be processed longer, setting it to higher values is not recommended, but if you want to make sure no edit is omitted (which only happen if there are more actions in last `cooldown` seconds than this value). `limit` amount of actions retrieved every `cooldown` amount of seconds. The higher it is the more network data will be used and the data will be processed longer, setting it to higher values is not recommended unless cooldown value is higher.
`webhookURL` webhook URL you can get using [channel settings in Discord](https://support.discordapp.com/hc/en-us/articles/228383668-Intro-to-Webhooks) `webhookURL` webhook URL you can get using [channel settings in Discord](https://support.discordapp.com/hc/en-us/articles/228383668-Intro-to-Webhooks)
`limitrefetch` limit of how many changes can be retrieved when refetch happens, cannot be lower than limit. -1 if you want to disable auto-refetch `limitrefetch` limit of how many changes can be retrieved when refetch happens, cannot be lower than limit. -1 if you want to disable auto-refetch
`wikiname` a name of the wiki the bot will work on, required in some messages `wikiname` a name of the wiki the bot will work on, required in some messages

View file

@ -508,7 +508,7 @@ def day_overview(): #time.strftime('%Y-%m-%dT%H:%M:%S.000Z', time.gmtime(time.ti
active_hours = [_("But nobody came")] active_hours = [_("But nobody came")]
numberu, numberh = (0, 0) numberu, numberh = (0, 0)
embed["fields"] = [] embed["fields"] = []
fields = ((_("Most active users"), ', '.join(active_users) + "({})".format(numberu)), (_("Edits made"), edits), (_("New files"), files), (_("Admin actions"), admin), (_("Bytes changed"), changed_bytes), (_("New articles"), new_articles), (_("Unique contributors"), str(len(activity))), (_("Most active hours"), ', '.join(active_hours) + "({})".format(numberh)), (_("Day score"), str(overall))) fields = ((_("Most active users"), ', '.join(active_users) + " ({})".format(numberu)), (_("Edits made"), edits), (_("New files"), files), (_("Admin actions"), admin), (_("Bytes changed"), changed_bytes), (_("New articles"), new_articles), (_("Unique contributors"), str(len(activity))), (_("Most active hours"), ', '.join(active_hours) + "UTC ({})".format(numberh)), (_("Day score"), str(overall)))
for name, value in fields: for name, value in fields:
embed["fields"].append({"name": name, "value": value}) embed["fields"].append({"name": name, "value": value})
data = {} data = {}