Created
February 28, 2022 19:41
-
-
Save robws/4895d5c7f7a9d474f76eb6f38f75eb93 to your computer and use it in GitHub Desktop.
Chrome-Console-Output-No-Source-Slack-Channel-List
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Functions | |
*/ | |
function consoleWithNoSource(...params) { | |
setTimeout(console.log.bind(console, ...params)); | |
} | |
/* | |
Channel List | |
*/ | |
channelsDivSelector="[aria-label='Channels']"; | |
attributeName="data-qa-channel-sidebar-channel-id" | |
var channelData=[] | |
var talkChannels=document.querySelectorAll('[data-qa-channel-sidebar-channel-type="channel"]') | |
talkChannels.forEach(function(thisChannel) { | |
var channelId = thisChannel.getAttribute('data-qa-channel-sidebar-channel-id') | |
//consoleWithNoSource(channelId) | |
//p-channel_sidebar__name | |
var channelName=thisChannel.querySelector('span.p-channel_sidebar__name').textContent; | |
// consoleWithNoSource(channelName) | |
//elem.querySelector('img').getAttribute('data-src'); | |
channelListItem=`channel,${channelId},${channelName}` | |
consoleWithNoSource(channelListItem) | |
//channelData.push(`channel,${channelId},${channelName}`) | |
}) | |
var peopleChannels=document.querySelectorAll('[data-qa-channel-sidebar-channel-type="im"]') | |
peopleChannels.forEach(function(thisChannel) { | |
var channelId = thisChannel.getAttribute('data-qa-channel-sidebar-channel-id') | |
//p-channel_sidebar__name | |
var channelName=thisChannel.querySelector('span.p-channel_sidebar__name').textContent; | |
//elem.querySelector('img').getAttribute('data-src'); | |
channelListItem=`talk,${channelId},${channelName}` | |
consoleWithNoSource(channelListItem) | |
}) | |
/* | |
var AllChannels= document.querySelectorAll("[" + attributeName + "]") | |
AllChannels.forEach(function(thisChannel) { | |
var channelId = thisChannel.getAttribute('data-qa-channel-sidebar-channel-id') | |
consoleWithNoSource(channelId) | |
//p-channel_sidebar__name | |
var channelName=thisChannel.querySelector('span.p-channel_sidebar__name').textContent; | |
consoleWithNoSource(channelName) | |
//elem.querySelector('img').getAttribute('data-src'); | |
}) | |
console.log(channels) | |
*/ | |
/* | |
channelSelector="div.p-channel_sidebar__channel > span.p-channel_sidebar__name" | |
channelNames=document.querySelectorAll(channelSelector) | |
channelNames.forEach(function(thisChannel) { | |
consoleWithNoSource(thisChannel.textContent) | |
}); | |
*/ | |
/* | |
dialogList=document.querySelectorAll('[data-qa="slack_kit_list"]'); | |
nameList=document.querySelectorAll('div.p-ia_details_popover__members_list'); | |
console.log(nameList) | |
*/ | |
//x=document.querySelectorAll("span.c-member__primary_content > span.c-member_name.c-base_entity__text > span > strong") | |
//}) > span.c-member_name.c-base_entity__text > span > strong") | |
/* | |
secondaryNames=document.querySelectorAll("span.c-member__primary_content > span.c-member__secondary-name.c-base_entity__text > span") | |
x.forEach(function(thisUser) { | |
console.log(thisUser) | |
}); | |
*/ | |
/* --- # Person --- */ | |
/* | |
mainSelector="#person-card-wrapper-with-reports > div.personinfo > div > div.name"; | |
//var mainPerson=document.querySelectorAll(mainSelector); | |
var mainPerson=document.querySelector(mainSelector); | |
console.log(mainPerson.textContent) | |
var peopleSelector=".reportscontainer"; | |
var people=document.querySelectorAll(peopleSelector); | |
people.forEach(function(personItem) { | |
// console.log(personItem.textContent) | |
personSelector="div.personinfo > div > div.name" | |
var thisPerson=personItem.querySelector(personSelector); | |
console.log(thisPerson.textContent) | |
}); | |
/* | |
mainPerson.forEach(function(userItem) { | |
console.log(userItem.textContent) | |
}); | |
*/ | |
/* | |
memberNames=document.querySelectorAll('[data-sk="medium_member_entity"]'); | |
var members=[]; | |
memberNames.forEach(function(thisMemberCard) { | |
//console.log(thisMemberCard) | |
primaryNameSelector=thisMemberCard.querySelector('[data-qa="member-entity__primary-name"] span') | |
secondaryNameSelector=thisMemberCard.querySelector('[data-qa="member-entity__secondary-name"] span') | |
titleSelector=thisMemberCard.querySelector('[data-qa="member-entity__title"]') | |
primaryName=(primaryNameSelector)?primaryNameSelector.textContent:"--" | |
secondaryName=(secondaryNameSelector)?secondaryNameSelector.textContent:"--" | |
jobTitle=(titleSelector)?titleSelector.textContent:"--" | |
members.push(`${primaryName},${secondaryName},${jobTitle}`) | |
}); | |
console.table(members); | |
*/ | |
/* | |
memberNames=document.querySelectorAll("span.c-member__primary_content"); | |
memberNames.forEach(function(thisMemberCard) { | |
primaryName=thisMemberCard.querySelector(' span.c-member_name.c-base_entity__text > span > strong'); | |
console.log(primaryName.textContent); | |
secondaryName=thisMemberCard.querySelector('span.c-member__secondary-name.c-base_entity__text > span '); | |
thisTitle=thisMemberCard.querySelector('span.c-member__title.c-base_entity__subtext'); | |
//var dataSrc = elem.querySelector('img').getAttribute('data-src'); | |
if (thisTitle) | |
console.log(thisTitle.textContent) | |
console.log(thisMemberCard) | |
//document.querySelector("#U01BCRQ7589 > div > div > div > div > span.c-member__title.c-base_entity__subtext") | |
}); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment