diff options
| -rw-r--r-- | cws-status | 25 |
1 files changed, 19 insertions, 6 deletions
@@ -1,5 +1,7 @@ #!/usr/bin/env python3 +import argparse +import os import re import sys from urllib import request @@ -12,17 +14,28 @@ EX_USAGE = 64 EX_NOUSER = 67 -if len(sys.argv) < 2: - print('error: missing regex argument', file=sys.stderr) - sys.exit(EX_USAGE) +argparser = argparse.ArgumentParser(description='Query the publish status of \ + extensions on the Chromw Web Store dashboard.') +argparser.add_argument( + '--url', + required=True, + help='Chrome Web Store dashboard URL' +) +argparser.add_argument( + '--cookie-path', + required=True, + help='path to a Google Chrome cookie file' +) +argparser.add_argument('name_regex', metavar='<name-regex>') -regex = sys.argv[1] +args = argparser.parse_args() -url = 'https://chrome.google.com/webstore/devconsole/<UUID>' +url = args.url +regex = args.name_regex cookie_jar = browser_cookie3.chrome( - cookie_file='<profile-cookie-file>', + cookie_file=os.path.expanduser(args.cookie_path), ) opener = request.build_opener(request.HTTPCookieProcessor(cookie_jar)) |
