2023-11-11 00:25:45 +00:00
|
|
|
"""GitMon"""
|
2023-11-11 01:35:04 +00:00
|
|
|
from loguru import logger
|
2023-11-11 00:25:45 +00:00
|
|
|
from gitmon.api import GitHubApi
|
|
|
|
|
2023-11-11 02:33:57 +00:00
|
|
|
from config import token
|
|
|
|
|
2023-11-11 00:25:45 +00:00
|
|
|
|
2023-11-11 01:26:21 +00:00
|
|
|
def print_event(event):
|
|
|
|
event_type = event.get('type')
|
|
|
|
repo = event.get('repo')
|
|
|
|
actor = event.get('actor')
|
|
|
|
|
|
|
|
print(f'{event_type}:\t{repo["name"]}, {actor["login"]}')
|
|
|
|
|
|
|
|
|
2023-11-11 00:25:45 +00:00
|
|
|
def main():
|
|
|
|
"""Main entry point."""
|
|
|
|
|
2023-11-11 02:33:57 +00:00
|
|
|
api = GitHubApi(token)
|
2023-11-11 00:25:45 +00:00
|
|
|
|
|
|
|
events = api.get_events()
|
|
|
|
for event in events:
|
2023-11-11 01:26:21 +00:00
|
|
|
print_event(event)
|
2023-11-11 00:25:45 +00:00
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
main()
|