Skip to content

Instantly share code, notes, and snippets.

@ptrin
Created February 20, 2019 16:58
Show Gist options
  • Save ptrin/e38766c2e6578f5a74201851ff76acda to your computer and use it in GitHub Desktop.
Save ptrin/e38766c2e6578f5a74201851ff76acda to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import csv
import os
import re
import sys
print "Input file of pages to assess: "+sys.argv[1]
def slug(str):
"""Replace non-alphanumeric characters with hyphen"""
slug = re.sub(r'[^\w]+', '-', str)
return slug
with open(sys.argv[1]) as tsvfile:
reader = csv.reader(tsvfile, delimiter='|')
for row in reader:
print row
os.system("docker-compose run openassessit "+row[1]+" "+slug(row[0])+" chrome")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment