Last active
March 8, 2021 16:44
-
-
Save estelsmith/b71b2548cb2253e1ba7174898b9db1e9 to your computer and use it in GitHub Desktop.
List card URLs in Trello
This file contains 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
(() => { | |
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