Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save SollyBunny/770cdf3b6fb48f3f6aa0b10a522c1856 to your computer and use it in GitHub Desktop.

Select an option

Save SollyBunny/770cdf3b6fb48f3f6aa0b10a522c1856 to your computer and use it in GitHub Desktop.
Get all repos with issues you have commented on
#!/bin/env python3
import requests
USERNAME = "SollyBunny"
repos = set()
page = 1
while True:
url = f"https://api.github.com/search/issues?q=commenter:{USERNAME}&per_page=100&page={page}"
r = requests.get(url).json()
items = r.get("items", [])
if not items:
break
for item in items:
repos.add(item["repository_url"].split("/")[-2] + "/" + item["repository_url"].split("/")[-1])
page += 1
for repo in repos:
print(repo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment