Skip to content

Instantly share code, notes, and snippets.

What would you like to do?

One way to get the commit history of GitHub wiki on browser

It's a memorandum to get the commit history of GitHub wiki on browser by JavaScript.


parse the history page(s) and generate TSV or JSON by JavaScript




  • You can read the commit history of all pages of GitHub wiki from this URL:${author}/${repository}/wiki/Home/_history
    • This page paginates every 25 items
  • If you want to get the data as a blob, you can arrange and use this script.
    • LICENCE: CC0
let history = new Array();
* parse HTML and hold data in ${history}
// get <ul>
let elemUl = document.querySelector('.Box--condensed ul');
// get <li>
let elemLi = elemUl.children;
for (li of elemLi) {
let rev = {
id: "",
title: "",
author: "",
date: ""
// get the hash = li.lastElementChild.innerText;
let mainCol = li.lastElementChild.previousElementSibling;
// get the commit message
rev.title = mainCol.firstElementChild.innerText;
// get the author/date
let subLow = mainCol.lastElementChild; = subLow.firstElementChild.firstElementChild.getAttribute('alt'); = subLow.lastElementChild.getAttribute('datetime');
// console.log(history);
* parse JavaScript Object to TSV
let tsvRaw = new Array();
for (low of history) {
* create and put textarea and display data
// create and put elements
let wrapDiv = document.createElement('div');
let textarea = document.createElement('textarea');
// display JSON
// textarea.textContent = JSON.stringify(history);
// display TSV
textarea.textContent = tsvRaw.join("\n");
// append textarea bottom of the page
document.getElementsByTagName('body')[0].appendChild(wrapDiv, document.querySelector(''));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.