-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathholiday_issues_finder.py
More file actions
52 lines (40 loc) Β· 1.51 KB
/
Copy pathholiday_issues_finder.py
File metadata and controls
52 lines (40 loc) Β· 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import os
import requests
def search_holiday_labels(token=None):
"""
Search for issues with holiday-themed labels.
"""
base_url = "https://api.github.com/search/issues"
headers = {
"Accept": "application/vnd.github.v3+json"
}
if token:
headers["Authorization"] = f"token {token}"
# Search for common holiday labels
holiday_labels = [
"hacktoberfest", # Festive coding event!
"advent", # Advent of Code
"christmas",
"holiday",
"good first issue", # Gift for new contributors! π
]
print("π·οΈ Searching for Holiday-Labeled Issues...\n")
for label in holiday_labels:
params = {
"q": f'label: "{label}" type:issue state: open',
"sort": "updated",
"order": "desc",
"per_page": 3
}
response = requests.get(base_url, headers=headers, params=params)
if response. status_code == 200:
data = response.json()
print(f"π Label: '{label}' - {data['total_count']} open issues")
for issue in data["items"][:3]:
repo = issue["repository_url"].replace("https://api.github.com/repos/", "")
print(f" βββ {issue['title'][:45]}...")
print(f" β βββ π {repo}")
print()
if __name__ == "__main__":
token = os.environ. get("GITHUB_TOKEN")
search_holiday_labels(token)