-
Notifications
You must be signed in to change notification settings - Fork 7
/
app.py
60 lines (54 loc) · 1.32 KB
/
app.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
import yaml
import argparse
from core.insights import get_insights
def main():
"""
The main context.
Start Time: 11/25 06.00 PM EST
"""
parser = argparse.ArgumentParser(
description='API Key'
)
required_named = parser.add_argument_group('mandatory arguments')
required_named.add_argument(
"-k",
"--key",
dest="apikey",
help="Send API Key"
)
required_named.add_argument(
"-b",
"--bucket",
dest="bucket",
help="Influx Bucket name"
)
required_named.add_argument(
"-i",
"--influxkey",
dest="influxkey",
help="Send Influx API Key"
)
required_named.add_argument(
"-u",
"--influxurl",
dest="influxurl",
help="Send Influx Cloud URL"
)
required_named.add_argument(
"-o",
"--influxorg",
dest="influxorg",
help="Send Influx Org"
)
args = parser.parse_args()
key = args.apikey
bucket = args.bucket
influxkey = args.influxkey
influxurl = args.influxurl
influxorg = args.influxorg
with open('urls.yaml') as url:
url = yaml.safe_load(url)
for site in url['Websites']:
get_insights(site, key, bucket, influxkey, influxurl, influxorg)
if __name__ == "__main__":
main()