From 7503a8effe5a4c37ba69d0a4fbfde8b3a111c66d Mon Sep 17 00:00:00 2001 From: agatha Date: Fri, 10 Nov 2023 20:26:21 -0500 Subject: [PATCH] Print events to terminal --- main.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index bffe2ec..b51ef81 100644 --- a/main.py +++ b/main.py @@ -2,6 +2,14 @@ from gitmon.api import GitHubApi +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"]}') + + def main(): """Main entry point.""" @@ -9,7 +17,7 @@ def main(): events = api.get_events() for event in events: - print(event['type']) + print_event(event) if __name__ == '__main__':