Merge pull request #230 from DavidCruciani/main

fix: [generator] remove header
pull/232/head
Alexandre Dulaunoy 2022-10-13 10:39:34 +02:00 committed by GitHub
commit f9e7599209
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -8,7 +8,7 @@ import argparse
def process(file, dst, numbers): def process(file, dst, numbers):
with open(get_abspath_source_file(file), newline='\n', encoding='utf-8', errors='replace') as csv_file: with open(get_abspath_source_file(file), newline='\n', encoding='utf-8', errors='replace') as csv_file:
sites = csv_file.readlines()[:numbers] sites = csv_file.readlines()[1:numbers]
warninglist = { warninglist = {
'name': f'Top {numbers} websites from Majestic Million', 'name': f'Top {numbers} websites from Majestic Million',

View File

@ -18,10 +18,16 @@ def process(files, dst):
'matching_attributes': ['hostname', 'domain', 'uri', 'url'] 'matching_attributes': ['hostname', 'domain', 'uri', 'url']
} }
flag = True
for file in files: for file in files:
with open(get_abspath_source_file(file)) as csv_file: with open(get_abspath_source_file(file)) as csv_file:
csv_reader = csv.reader(csv_file, delimiter=',') csv_reader = csv.reader(csv_file, delimiter=',')
for row in csv_reader: for row in csv_reader:
if flag:
flag = False
print(True)
continue
v = row[1] v = row[1]
warninglist['list'].append(v.rstrip().rstrip('/')) warninglist['list'].append(v.rstrip().rstrip('/'))