Print events to terminal

This commit is contained in:
agatha 2023-11-10 20:26:21 -05:00
parent 8a9200e627
commit 7503a8effe

10
main.py
View File

@ -2,6 +2,14 @@
from gitmon.api import GitHubApi 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(): def main():
"""Main entry point.""" """Main entry point."""
@ -9,7 +17,7 @@ def main():
events = api.get_events() events = api.get_events()
for event in events: for event in events:
print(event['type']) print_event(event)
if __name__ == '__main__': if __name__ == '__main__':