From ca73e2dc543dc0d1b835a396a3ffdad8e059d975 Mon Sep 17 00:00:00 2001 From: Tristan Smith Date: Wed, 20 Mar 2024 21:00:51 -0400 Subject: [PATCH] ehhhhhhhh --- main.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..4f05df9 --- /dev/null +++ b/main.py @@ -0,0 +1,21 @@ +import requests +import webbrowser +import random # Import the random module + +def get_random_repo(): + url = "https://api.github.com/repositories" + response = requests.get(url) + repos = response.json() + # Pick a random repo from the list of repos + random_repo = random.choice(repos) + return random_repo + +def main(): + repo = get_random_repo() + print(repo['html_url']) # Print the URL of the random repo + + # Ensure the returned link opens in the default browser + webbrowser.open(repo['html_url']) + +if __name__ == "__main__": + main()