let groups = [];
let links = document.querySelectorAll('a[href*="/groups/"]');
links.forEach(a => {
    let url = a.href.split('?')[0]; 
    let name = a.innerText.trim();
    
    let match = url.match(/\/groups\/([^\/]+)\/?$/);
    if(name && !name.includes("Joined") && match) {
        let groupId = match[1];
        groups.push(name + "\t" + groupId);
    }
});

let uniqueGroups = [...new Set(groups)];
console.log("TÊN NHÓM \t GROUP ID (Hoặc Tên Tùy Chỉnh)");
console.log(uniqueGroups.join('\n'));
