-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathparse_curl.py
39 lines (36 loc) · 1.19 KB
/
parse_curl.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
import glob
websites_without_timer = []
websites_with_timer = []
search_engines = []
# read all files in the directory
read_websites_untimers = glob.glob('untimers/*')
read_websites_with_timers = glob.glob('timers/*')
read_search_engines = glob.glob('search_engine/*')
# read all content of files in the directory
for i in read_websites_untimers:
with open(i, 'r') as f:
try:
curl_command = f.read().replace('\n', '').replace('\ ', '')
websites_without_timer.append(curl_command)
except:
pass
# read all content of files in the directory
for i in read_websites_with_timers:
with open(i, 'r') as f:
try:
curl_command = f.read().replace('\n', '').replace('\ ', '')
websites_with_timer.append(curl_command)
except:
pass
for i in read_search_engines:
with open(i, 'r') as f:
try:
curl_command = f.read().replace('\n', '').replace('\ ', '')
search_engines.append(curl_command)
except:
pass
if __name__ == '__main__':
# write content of files in the directory
print(websites_without_timer)
print(websites_with_timer)
print(search_engines)