def parse_data(action, data):
    """Parse an action's data field, return action with updated vals."""
    d = data['data'][0]
    # Post data
    if 'post' in d:
        action['action'] = 'post'
        action['description'] = d['post']
    # Comment data
    if 'comment' in d:
        action['action'] = 'comment'
        action['action_type'] = 'comment'
        if type(d['comment']) is str:
            action['description'] = d['comment']
        elif type(d['comment']) is dict:
            action['description'] = d['comment']['comment']
            action['person'] = d['comment']['author']
    return action