-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathextractCodeFromUrl.py
197 lines (151 loc) · 5.1 KB
/
extractCodeFromUrl.py
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
import requests
import time
def download_file(url, wait=False):
if wait:
time.sleep(10)
try:
req = requests.request('GET', url, timeout = None)
except requests.exceptions.RequestException as e: # This is the correct syntax
# raise SystemExit(e)
# print(e)
return None
# req = requests.get(url, timeout = None)
return(req.text)
def gitsavannahgnuorgCode(url):
if 'blob' in url:
urlnew = url.replace('blob', 'blob_plain')
elif 'tree' in url:
urlnew = url.replace('tree','plain')
return(download_file(urlnew))
def gitsambaorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew, wait = True))
def gitphpnet(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def cgitkdeorg(url):
urlnew = url.replace('tree', 'plain')
return(download_file(urlnew))
def gitganetiorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gitbusyboxnet(url):
urlnew = url.replace('tree', 'plain')
return(download_file(urlnew))
def gitttrssorg(url):
urlnew = url.replace('src', 'raw')
return(download_file(urlnew))
def gitopensslorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gitkernelorg(url):
urlnew = url.replace('tree', 'plain')
return(download_file(urlnew))
def gitghostscriptcom(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gitmoodleorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gitspipnet(url):
urlnew = url.replace('src', 'raw')
return(download_file(urlnew))
def githaproxyorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def cgitfreedesktoporg(url):
urlnew = url.replace('tree', 'plain')
return(download_file(urlnew))
def gitshibbolethnet(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gitpengutronixde(url):
urlnew = url.replace('tree', 'plain')
return(download_file(urlnew))
def gitnetfilterorg(url):
urlnew = url.replace('tree', 'plain')
return(download_file(urlnew))
def gitqemuorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gitlinuxtvorg(url):
urlnew = url.replace('tree', 'plain')
return(download_file(urlnew))
def gitmusllibcorg(url):
urlnew = url.replace('tree', 'plain')
return(download_file(urlnew))
def gitinfradeadorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def anongitmindrotorg(url):
urlnew = url.replace('tree', 'plain')
return(download_file(urlnew, wait = True))
def gitpostgresql(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def githylafaxorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gitlinuxnfsorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gitlinaroorg(url):
urlnew = url.replace('tree', 'plain')
return(download_file(urlnew))
def gitaltlinuxorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gitgnupgorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gitdelugetorrentorg(url):
urlnew = url.replace('tree', 'plain')
return(download_file(urlnew))
def gitlxdeorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def htcondorgitcswiscedu(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gitquasselircorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gitlibavorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gittartarusorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gitstrongswanorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gitopenafsorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def giteximorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gitlysatorliuse(url):
urlnew = url.replace('blob', 'raw')
return(download_file(urlnew))
def gitlibsshorg(url):
urlnew = url.replace('tree', 'plain')
return(download_file(urlnew))
def giteyrieorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gittukaaniorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gitlaunchpadnet(url):
urlnew = url.replace('tree', 'plain')
return(download_file(urlnew))
def gitjetbrainsorg(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gitwpitchounenet(url):
urlnew = url.replace('blob', 'blob_plain')
return(download_file(urlnew))
def gitenlightenmentorg(url):
urlnew = url.replace('tree', 'plain')
return(download_file(urlnew))