Page MenuHomeWildfire Games
Paste P239

Phab commit list to text scrapper
ActivePublic

Authored by Stan on Sat, Jan 30, 2:08 PM.
var a = Array.from($(".phui-oi-list-view").children).map(li => {
let tableElement = li.children[0].children[0].children[0].children[0].children[0].children;
let commitNumber = tableElement[1].children[0].children[0].innerText;
let revisionTitle = tableElement[1].children[0].children[1].innerText;
let contributor = tableElement[2].children[1].children[0].children[0].text;
return {
"contributor": contributor,
"commitNumber": commitNumber,
"revisionTitle": revisionTitle,
"revisionUrl": "https://code.wildfiregames.com/" + commitNumber,
}
}).reduce(function (rv, x) {
(rv[x.contributor] = rv[x.contributor] || []).push({
"revisionTitle": x.revisionTitle,
"commitNumber": x.commitNumber,
"revisionUrl": x.revisionUrl
});
return rv;
}, {})
var div = document.createElement("div");
sortedContributors = Object.keys(a).filter(b => b != "autobuild");
sortedContributors.sort((a, b) => a.toLowerCase().localeCompare(b.toLowerCase()))
div.innerHTML = sortedContributors.map(contributorName => {
var contributorData = a[contributorName];
var string = `<strong>${contributorName}</strong> committed:\n<ul>`
for (let commit of contributorData) {
string += `<li>${commit.commitNumber} <a href="${commit.revisionUrl}">${commit.revisionTitle}</a><li>`
}
string += `</ul>`
return string;
}).join("<br/>")
$("#main-page-frame").prepend(div)

Event Timeline

Stan created this paste.Sat, Jan 30, 2:08 PM
Stan created this object with visibility "Public (No Login Required)".