Magic: the Gathering

أخبار

How to download your Planeswalker Points History

, محدث , Comment regular icon0 comments

Two programmers created scripts that allow you to download all your history to a CSV file

Writer image

تمت مراجعته من قبل Tabata Marques

Edit Article

Many players are saddened by the announcement of the end of the DCI. Wizards declared its end without providing tools to download your history or any other way for you to remember your past.

Two programmers, José Moreira and Zachary Langlink outside website, decided to "fix it", so that you can see their history at any time. The two created scripts that allow you to download all your history to a CSV file.

Let's look at it step by step; remembering that the original tutorial can be seen in English herelink outside website.

Ad

STEP 1

Go to the Wizards of the Coast page with your account. Search for your history on the websitelink outside website.

Image content of the Website

SPET 2

Access your browser console. In Chrome you can access it by clicking on F12. After that, click on "Console" to be able to write code on your page.

Image content of the Website

STEP 3

Within the console page write the following:

document.querySelectorAll('a.Expand').forEach(a=>{

a.focus();

a.click();

});

document.querySelectorAll('.MatchOpponentTeamExpand a').forEach(a=>{

a.focus();

a.click();

});

The top code must be copied and pasted to the console. Then hit enter to run. Your events should start to open, wait for everyone to open.

STEP 4

After all events are open, copy the following code into the console:

let content = '"date","description","store","location","points","pro points","multiplier","total event players","format","place","round number","result","opponent"\r\n';

document.querySelectorAll('.HistoryPanelRow').forEach(row=>{

//console.log(content);

const date = row.querySelector('.Date').innerText.trim() || "";

const description = row.querySelector('.Description').innerText.trim().replace(/""/g,'\"') || "";

const location = row.querySelector('.Location').innerText.trim().replace(/""/g,'\"') || "";

const lifetimepoints = row.querySelector('.LifetimePoints').innerText.trim() || "";

const propoints = row.querySelector('.ProPoints').innerText.trim() || "";

const multiplier = row.querySelector('.EventMultiplier') ? row.querySelector('.EventMultiplier').innerText.trim() : "";

const totalPlayers = row.querySelector('.EventPlayers') ? row.querySelector('.EventPlayers').innerText.trim() : "";

const eventFormat = row.querySelector('.EventFormat') ? row.querySelector('.EventFormat').innerText.trim() : "";

const eventLocation = row.querySelector('.EventLocation') ? row.querySelector('.EventLocation').innerText.trim().replace(/""/g,'\"') : "";

const place = row.querySelector('.EventPlace') ? row.querySelector('.EventPlace').innerText.trim() : "";

row.querySelectorAll('.MatchHistoryTable .MatchHistoryRow').forEach(match=>{

const roundNumber = match.querySelector('.MatchPlace') ? match.querySelector('.MatchPlace').innerText.trim() : "";

const result = match.querySelector('.MatchResult') ? match.querySelector('.MatchResult').innerText.trim() : "";

let opp = match.querySelector('.MatchOpponent') ? match.querySelector('.MatchOpponent').innerText.trim().replace(/""/g,'\"') : "";

if(match.querySelector('.MatchOpponentTeam')){

opp += ' ';

match.querySelectorAll('.MatchOpponentTeam div').forEach(teamopp=>{

opp += teamopp.innerText.trim().replace(/""/g,'\"') + ', ';

});

}

content += `"${date}","${description}","${location}","${eventLocation}","${lifetimepoints}","${propoints}","${multiplier}","${totalPlayers}","${eventFormat}","${place}","${roundNumber}","${result}","${opp}"\r\n`;

Ad

});

});

let link = document.createElement('a')

link.id = 'download-csv'

link.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(content));

link.setAttribute('download', 'pwp.export.csv');

document.body.appendChild(link)

document.querySelector('#download-csv').click();

STEP 5

Wait a while and a CSV file with all your history should be downloaded. Each browser can react differently, so if you run into problems, we suggest posting them on the developers Githublink outside website.

A special thanks to Azhariel for informing this tool.

"Unfortunately Wizards is going to retire DCI and Planeswalker Points. On the website there is no option to save the game history, but there is a way for everything! Following these steps you can save everything in a spreadsheet" - published Azhariel.