Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Run Inspector Console in chrome and copy and paste the following code in the /stats/stories view
- function download(filename, text) {
- var pom = document.createElement('a');
- pom.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
- pom.setAttribute('download', filename);
- if (document.createEvent) {
- var event = document.createEvent('MouseEvents');
- event.initEvent('click', true, true);
- pom.dispatchEvent(event);
- }
- else {
- pom.click();
- }
- }
- content = "";
- rows = document.querySelectorAll(".sortableTable-row.js-statsTableRow")
- rows.forEach(function(row) {
- title = row.querySelectorAll("h2.sortableTable-title")[0].innerText
- values = row.querySelectorAll(".sortableTable-value")
- views = values[1].innerText
- reads = values[2].innerText
- readRatio = values[3].innerText
- recommends = values[4].innerText
- content += title + ";" + views + ";" + reads + ";" + readRatio + ";" + recommends + "\n"
- });
- download("medium-metrics-" + new Date().toISOString().slice(0, 10) + ".csv", content)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement