Skip to content

Instantly share code, notes, and snippets.

@estelsmith
Last active March 8, 2021 16:44
Show Gist options
  • Save estelsmith/b71b2548cb2253e1ba7174898b9db1e9 to your computer and use it in GitHub Desktop.
Save estelsmith/b71b2548cb2253e1ba7174898b9db1e9 to your computer and use it in GitHub Desktop.
List card URLs in Trello
(() => {
const origin = window.location.origin;
const report = [];
const ignoreLists = ['Recently Released', 'Complete'];
const board = document.getElementById('board');
const lists = board.querySelectorAll('.list');
const boardName = document.querySelector('.board-header-btn-text').textContent;
lists.forEach((list) => {
const header = list.querySelector('.list-header');
const listName = header.querySelector('.list-header-name-assist').textContent;
if (ignoreLists.indexOf(listName) !== -1) {
return;
}
const cards = list.querySelectorAll('.list-card');
cards.forEach((card) => {
const uri = origin + card.getAttribute('href');
const title = card.querySelector('.list-card-title').lastChild.textContent;
report.push({
'Board': boardName,
'List': listName,
'Title': title,
'URL': uri
});
});
});
console.table(report);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment