ehhhhhhhh
This commit is contained in:
commit
ca73e2dc54
1 changed files with 21 additions and 0 deletions
21
main.py
Normal file
21
main.py
Normal file
|
@ -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()
|
Loading…
Reference in a new issue