Skip to content

Instantly share code, notes, and snippets.

@alik604
Last active January 28, 2024 15:07
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alik604/d54ec58a8233fbe8880d5f75d1984682 to your computer and use it in GitHub Desktop.
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
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