def get_user_id(tweet):
    """ Get user's id from a tweet object
    :param tweet: JSON object
    :return: (new_id, None) for RTs/Tweets and (new_id, ref_id) for RT w/ comments
    """
    new_id, ref_id = None, None

    try:
        new_id = tweet['actor']['id']
    except KeyError as e:
        pass

    try:
        new_id = tweet['user']['id']
    except KeyError as e:
        pass

    try:  # old retweets
        ref_id = tweet['retweeted_status']['quoted_status']['user']['id']
    except KeyError:
        pass

    try:  # GNIP format
        ref_id = tweet['object']['twitter_quoted_status']['actor']['id']
    except KeyError:
        pass

    return new_id, ref_id