def get_ua_platform(user_agent):
    """Get platform (mobile, tablet, pc)."""
    if user_agent.is_mobile:
        return "mobile"
    elif user_agent.is_tablet:
        return "tablet"
    elif user_agent.is_pc:
        return "pc"
    else:
        return "unknown"