-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathissues.py
More file actions
executable file
·40 lines (30 loc) · 978 Bytes
/
issues.py
File metadata and controls
executable file
·40 lines (30 loc) · 978 Bytes
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
#!/usr/bin/env python3
def main():
from bs4 import BeautifulSoup
from fileinput import input
from requests import get
from re import compile
user = "JacobBHartman"
repo = "feoh"
url = "https://github.com/" + user + "/" + repo + "/issues"
r = get(url)
html = r.text
soup = BeautifulSoup(html, 'html.parser')
#number = soup.find_all("span", {"class" : "opened-by"})
#print(number)
#issues = soup.find('div', {"aria-label" : "Issues"})
#print(issues.prettify())
#soup.find_all("div", aria-label='Issues')
s = ""
issues = soup.find_all("a", {"id" : compile("^(issue_).+(_link)")})
for issue in issues:
s += "<li>" + issue.text + "</li>"
index_dir = ("static/")
fin = open(index_dir + "index.html", "rt")
data = fin.read()
data = data.replace("ISSUES GO HERE", s)
fin.close()
fin = open(index_dir + "index.html", "wt")
fin.write(data)
fin.close()
main()