Browse Source

get rid of beginners mistake: credentials in external file

filtering
Ruben van de Ven 1 year ago
parent
commit
25cbebca65
  1. 4
      no_credentials.json
  2. 10
      wiki_relations.py

4
no_credentials.json

@ -0,0 +1,4 @@ @@ -0,0 +1,4 @@
{
"user": "",
"password": ""
}

10
wiki_relations.py

@ -19,9 +19,6 @@ default_categories = [ @@ -19,9 +19,6 @@ default_categories = [
'Country',
]
username = "Ruben2@SemanticGraphFetcher"
password = "bdqjse4jodn34rbj73l0agrtb306v693"
parser = argparse.ArgumentParser(description='Turn wiki into nodes & links, usable by d3-force.')
parser.add_argument('--categories', metavar='categories', default=default_categories, nargs='+',
help='Categories')
@ -29,9 +26,16 @@ parser.add_argument('--url', default="https://www.securityvision.io/wiki/api.ph @@ -29,9 +26,16 @@ parser.add_argument('--url', default="https://www.securityvision.io/wiki/api.ph
help='Wiki API URL')
parser.add_argument('--output', default="semantic_data.json",
help='Output JSON file')
parser.add_argument('--credentials', default="no_credentials.json",
help="JSON file containing the Bot's credentials")
args = parser.parse_args()
with open(args.credentials) as fp:
credentials = json.load(fp)
username = credentials['user']
password = credentials['password']
def get_session():
S = requests.Session()

Loading…
Cancel
Save