Skip to content

Instantly share code, notes, and snippets.

@jbeezley
Created November 16, 2019 16:24
Show Gist options
  • Save jbeezley/42f77a3c74ac6fe4c698dc4a433015a1 to your computer and use it in GitHub Desktop.
Save jbeezley/42f77a3c74ac6fe4c698dc4a433015a1 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
import json
import sys
def main(ids):
if not len(ids):
print('Usage: %s id [id [id ...] ]' % sys.argv[0])
sys.exit(1)
try:
with open('all-activities.json', 'r') as f:
map = json.load(f)
except Exception:
url = 'https://gist.github.com/jbeezley/cf987e4152167bbf888910e60803037a'
print('Download the activity list from ' + url)
raise
for id in ids:
if id not in map:
print('Could not find %s' % id)
else:
print(map[id])
if __name__ == '__main__':
main(sys.argv[1:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment