def GetOriginFromDataUnit(data_unit):
    """ Return a shortened origin string from the data unit

    E.g. 'fb' for Facebook, 'tw' for Twitter

    Returns: shortened origin (string)
    """

    origin = data_unit.get('origin', '').lower()
    if origin == 'facebook':
        origin = 'fb'
    elif origin == 'twitter':
        origin = 'tw'

    return origin