This small script pick a random card in a column on a Trello board.
We use this script at Kuzzle to pick a random card for our product workshop.
Change the number of the column from which you want to take a random card. For example to pick a card in the first column of the board:
var column = 1;
fetch(document.querySelector(`#board > div:nth-child(${column}) > div > div.list-cards.u-fancy-scrollbar.u-clearfix.js-list-cards.js-sortable.ui-sortable`).children[Math.floor(Math.random() * Math.floor(document.querySelector(`#board > div:nth-child(${column}) > div > div.list-cards.u-fancy-scrollbar.u-clearfix.js-list-cards.js-sortable.ui-sortable`).children.length))].getAttribute("href")).then((data) => {document.location = data.url })
How do you use this one?