auto-update on Sun Nov 21 23:35:28 UTC 2021

This commit is contained in:
Alec Muffett 2021-11-21 23:35:28 +00:00
parent 180cb95cb6
commit f822c57e77
5 changed files with 189 additions and 332 deletions

View file

@ -8,7 +8,7 @@ import html
output_csv = 'securedrop-api.csv'
sd_url = 'https://securedrop.org/api/v1/directory/'
fieldnames = "legacy flaky category site_name onion_name onion_addr onion_url proof_url comment".split()
fieldnames = "flaky category site_name onion_name onion_url proof_url comment".split()
def xx(thing, key):
val = thing.get(key, None) or '' # catches instance where key=existing and val=None
@ -17,12 +17,10 @@ def xx(thing, key):
def push(stack, entry):
method = 'http' # this needs some discussion with Securedrop
result = dict()
result['legacy'] = 'FALSE'
result['flaky'] = ''
result['category'] = 'securedrop'
result['site_name'] = xx(entry, 'title')
result['onion_url'] = '{0}://{1}'.format(method, xx(entry, 'onion_address'))
result['onion_addr'] = '*TBD*' # not really needed
result['onion_name'] = xx(entry, 'onion_name')
result['proof_url'] = xx(entry, 'landing_page_url')
result['comment'] = 'via: {}'.format(sd_url)