Last active
April 24, 2025 10:07
-
-
Save alik604/d54ec58a8233fbe8880d5f75d1984682 to your computer and use it in GitHub Desktop.
Open all starred GitHub repositories in new tab - Open every starred GitHub repo in chrome, with python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
import webbrowser | |
USER = "alik604" | |
chrome_path = 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s' | |
# Change to your OS - https://stackoverflow.com/a/24353812/5728614 | |
req = requests.get('https://api.github.com/users/' + USER + '/starred?per_page=100') | |
# ?page=2&per_page=100 # page is not working, first result is always the same | |
parsed = req.json() | |
print(f'{len(parsed)} items') | |
for i in range(len(parsed)): | |
url = parsed[i]["html_url"] | |
print(f'Opening {url}') | |
webbrowser.get(chrome_path).open_new_tab(url) | |
if i % 10 == 0: | |
_ = input("press any key to open the next 10 tabs") | |
print("If you dont see this, there is a issue with your IDE") # sublime text is a offended |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment