Created
March 14, 2017 14:43
-
-
Save cnelson/03e1cbaf0ce1472ef67fc765c3eb70e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import re | |
import subprocess | |
import yaml | |
import datetime | |
since=datetime.datetime(2017, 2, 28, 0, 0, 0) | |
# get one user toget the total number | |
check = yaml.load(subprocess.check_output(['uaac', 'users', '--attributes', 'username', '--count', '1'])) | |
total = check['totalresults'] | |
data = yaml.load(subprocess.check_output(['uaac', 'users', '--attributes', 'username', '--attributes', 'meta.created', '--attributes', 'verified', '--count', str(total)])) | |
assert data['itemsperpage'] == total | |
is_email=r"(^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$)" | |
for user in data['resources']: | |
if re.match(is_email, user['username']) and user['meta.created'] >= since: | |
user['created'] = user['meta.created'] | |
print("{username}\t{created}".format(**user)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment