Those two bookmarklet allows you to export the content of your funretro board as markdown and empty your board.
To use them simply create a new bookmark and copy past the code in the url field. Then you only need to click on the bookmark to execute the script.
javascript: !function(){const e=window.location.pathname.split("/")[3],t=e=>{let t,n="";Object.values(e).sort((e,t)=>e.type.id-t.type.id).map(e=>{t!==e.type.id&&(t=e.type.id,n+=`\n###Column ${e.type.id}:\n`),cardContent=e.text+` **+${(e=>e.votes?Object.values(e.votes).reduce((e,t)=>e+t):0)(e)}**`,n+=`- ${cardContent}\n`}),(e=>{const t=document.createElement("textarea"),n=document.getSelection();t.textContent=e,document.body.appendChild(t),n.removeAllRanges(),t.select(),document.execCommand("copy"),n.removeAllRanges(),document.body.removeChild(t)})(n)};(async()=>{t(await(async()=>(await firebase.database().ref(`/messages/${e}/`).once("value")).val())()),console.log("Card contents are in your clipboard")})()}();javascript: !function(){const a=window.location.pathname.split("/")[3],e=e=>{Object.keys(e).forEach(e=>{(async e=>{await firebase.database().ref(`/messages/${a}/${e}`).remove()})(e)})};(async()=>{e(await(async()=>(await firebase.database().ref(`/messages/${a}/`).once("value")).val())())})()}();javascript: (function() {
const BOARD_ID = window.location.pathname.split('/')[3],
copy = text => {
const node = document.createElement('textarea');
const selection = document.getSelection();
node.textContent = text;
document.body.appendChild(node);
selection.removeAllRanges();
node.select();
document.execCommand('copy');
selection.removeAllRanges();
document.body.removeChild(node);
},
getCards = async () => {
return (
await firebase
.database()
.ref(`/messages/${BOARD_ID}/`)
.once('value')
).val();
},
computeCardVotes = card =>
card.votes
? Object.values(card.votes).reduce(
(accumulator, currentValue) => accumulator + currentValue
)
: 0,
copyMessages = cards => {
let exportedText = '';
let columnType;
Object.values(cards)
.sort((firstItem, secondItem) => firstItem.type.id - secondItem.type.id)
.map(card => {
if (columnType !== card.type.id) {
columnType = card.type.id;
exportedText += `\n###Column ${card.type.id}:\n`;
}
cardContent = card.text + ` **+${computeCardVotes(card)}**`;
exportedText += `- ${cardContent}\n`;
});
copy(exportedText);
},
runScript = async () => {
copyMessages(await getCards());
console.log('Card contents are in your clipboard');
};
runScript();
})();javascript: (function() {
const BOARD_ID = window.location.pathname.split('/')[3],
getMessages = async () => {
return (
await firebase
.database()
.ref(`/messages/${BOARD_ID}/`)
.once('value')
).val();
},
removeMessageById = async cardId => {
await firebase
.database()
.ref(`/messages/${BOARD_ID}/${cardId}`)
.remove();
},
removeMessages = cards => {
Object.keys(cards).forEach(cardId => {
removeMessageById(cardId);
});
},
runScript = async () => {
removeMessages(await getMessages());
};
runScript();
})();