File tree 3 files changed +18
-1
lines changed
3 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -46,4 +46,10 @@ def linestodisplay(linestring, maxlines):
46
46
vlines .sort ()
47
47
while vlines [- 1 ] > int (maxlines ):
48
48
vlines .remove (vlines [- 1 ])
49
- return vlines
49
+ return vlines
50
+
51
+ def github_contribution (url ):
52
+ response = requests .get (url , headers = HEADER )
53
+ soup = BeautifulSoup (response .text , "lxml" )
54
+ div = soup .find ("div" , {"class" : "js-yearly-contributions" })
55
+ return str (div )
Original file line number Diff line number Diff line change @@ -35,5 +35,11 @@ def gistify(url):
35
35
except :
36
36
return render_template ('error.html' , url = url )
37
37
38
+ @app .route ('/contribution/<username>' )
39
+ def contribution (username ):
40
+ url = "https://github.com/" + username
41
+ document = github_contribution (url )
42
+ return render_template ('contribution.html' , document = Markup (document ))
43
+
38
44
if __name__ == '__main__' :
39
45
app .run (host = '127.0.0.1' , port = 8080 , debug = True )
Original file line number Diff line number Diff line change
1
+ < link crossorigin ="anonymous " media ="all " integrity ="sha512-5Bs4ERl99/u2AUfpOZF2F0cdfNby7+Vd9teUshXUBPo5CjwECR7IAEf+weI/eCk5tF7K1h3O8hd8k0+P/HePeg== " rel ="stylesheet " href ="https://github.githubassets.com/assets/frameworks-e41b3811197df7fbb60147e939917617.css ">
2
+ < link crossorigin ="anonymous " media ="all " integrity ="sha512-21eX2YaEYIYa91WFh0mXaxJ3wLQxy2ldlpRbyuCueK3MvqHGEzmXYPkMQ4XBtASauZXKlL1hPxQQU9g28R03wQ== " rel ="stylesheet " href ="https://github.githubassets.com/assets/site-db5797d9868460861af755858749976b.css ">
3
+ < link crossorigin ="anonymous " media ="all " integrity ="sha512-vna9AxrJa9t+A93H0lxAPca1mXWQB5A/jIBppkp+Ys/EV2l+rsMcCyU/Fj4BpmEZ3nY4hHwJ/FqUEeMFXiYl0w== " rel ="stylesheet " href ="https://github.githubassets.com/assets/github-be76bd031ac96bdb7e03ddc7d25c403d.css ">
4
+
5
+ {{ document }}
You can’t perform that action at this time.
0 commit comments