From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.

/* The following code produces the data found at [[Wikipedia:WikiProject National Register of Historic Places/Progress/History]]

   by looking back through old revisions of the [[WP:NRHPPROGRESS]] page. The data can then be used to create graphs

*/



var StatesArray=

    "Alabama","AL"],

    "Alaska","AK"],

    "Arizona","AZ"],

    "Arkansas","AR"],

    "California","CA"],

    "Colorado","CO"],

    "Connecticut","CT"],

    "Delaware","DE"],

    "District of Columbia","DC"],

    "Florida","FL"],

    "Georgia","GA"],

    "Hawaii","HI"],

    "Idaho","ID"],

    "Illinois","IL"],

    "Indiana","IN"],

    "Iowa","IA"],

    "Kansas","KS"],

    "Kentucky","KY"],

    "Louisiana","LA"],

    "Maine","ME"],

    "Maryland","MD"],

    "Massachusetts","MA"],

    "Michigan","MI"],

    "Minnesota","MN"],

    "Mississippi","MS"],

    "Missouri","MO"],

    "Montana","MT"],

    "Nebraska","NE"],

    "Nevada","NV"],

    "New Hampshire","NH"],

    "New Jersey","NJ"],

    "New Mexico","NM"],

    "New York","NY"],

    "North Carolina","NC"],

    "North Dakota","ND"],

    "Ohio","OH"],

    "Oklahoma","OK"],

    "Oregon","OR"],

    "Pennsylvania","PA"],

    "Rhode Island","RI"],

    "South Carolina","SC"],

    "South Dakota","SD"],

    "Tennessee","TN"],

    "Texas","TX"],

    "Utah","UT"],

    "Vermont","VT"],

    "Virginia","VA"],

    "Washington","WA"],

    "West Virginia","WV"],

    "Wisconsin","WI"],

    "Wyoming","WY"],

    "Puerto Rico","PR"],

    "Guam","GU"],

    "Virgin Islands","VI"],

    "Northern Mariana Islands","MP"],

    "American Samoa","AS"],

    "Federated States of Micronesia","FM"],

    "Palau","PW"],

    "Marshall Islands","MH"],

    "Minor Outlying Islands","UM"],

    ];



function ProgressPageHistoryButton() {

    if (mw.config.get('wgPageName')!="Wikipedia:WikiProject_National_Register_of_Historic_Places/Progress/History") return

    var button=document.createElement("input")

    button.setAttribute("type", "button");

    button.setAttribute("value", "Get Progress Page History");

    button.setAttribute("id", "historybutton");

    button.setAttribute("onclick", "HistoryButtonClick()");

    var content=document.getElementById('mw-content-text')



    content.parentNode.insertBefore(button, content)

}





function HistoryButtonClick() {

    var button=document.getElementById("historybutton")

    button.value="Working..."

    button.disabled=true



    var ProgressDiv = document.createElement('div')

    ProgressDiv.setAttribute('id', 'ProgressDiv')

    ProgressDiv.setAttribute("style", "width:500px; border:1px solid black; padding:5px")

    button.parentNode.insertBefore(ProgressDiv, button)

    ProgressDiv.innerHTML = "Querying old edits"

    GetProgressPageHistory()

}



function GetProgressPageHistory() {

    var ProgressDiv = document.getElementById("ProgressDiv")



    var Updates = [];

    var wikitext = ''

    ProgressDiv.innerHTML+="."



    var RevsWithMapsSection = JSON.parse(

        $.ajax({

            dataType: "json",

            url: mw.util.wikiScript('api'),

            data: {

                format: 'json',

                rawcontinue: 'true',

                action: 'query',

                prop: 'revisions',

                rvprop: 'timestamp|comment|content',

                rvlimit: 'max',

                rvendid: '568713090',

                rvsection: '2',

                titles: 'Wikipedia:WikiProject National Register of Historic Places/Progress'

            },

            async:false

        })

        .responseText

    );

    for (var r in RevsWithMapsSection.query.pages"38959189"].revisions) {

        if (RevsWithMapsSection.query.pages"38959189"].revisionsr].comment.indexOf("Updating county data as of ")>-1) {

            UpdatesUpdates.length = RevsWithMapsSection.query.pages"38959189"].revisionsr].timestamp,RevsWithMapsSection.query.pages"38959189"].revisionsr]["*"]]

        }

    }

    if (RevsWithMapsSection"query-continue"]) {

        var rvcontinue = RevsWithMapsSection"query-continue"].revisions.rvcontinue

        while (true) {

            ProgressDiv.innerHTML+="."

            var RevsWithMapsSection = JSON.parse(

                $.ajax({

                    dataType: "json",

                    url: mw.util.wikiScript('api'),

                    data: {

                        format: 'json',

                        action: 'query',

                        prop: 'revisions',

                        rvprop: 'timestamp|comment|content',

                        rvlimit: 'max',

                        rvcontinue: rvcontinue,

                        rawcontinue: 'true',

                        rvendid: '568713090',

                        rvsection: '2',

                        titles: 'Wikipedia:WikiProject National Register of Historic Places/Progress'

                    },

                    async:false

                })

                .responseText

            );

            for (var r in RevsWithMapsSection.query.pages"38959189"].revisions) {

                if (RevsWithMapsSection.query.pages"38959189"].revisionsr].comment.indexOf("Updating county data as of ")>-1) {

                    UpdatesUpdates.length = RevsWithMapsSection.query.pages"38959189"].revisionsr].timestamp,RevsWithMapsSection.query.pages"38959189"].revisionsr]["*"]]

                }

            }

            if (RevsWithMapsSection"query-continue"]) {

                rvcontinue = RevsWithMapsSection"query-continue"].revisions.rvcontinue

            } else {

                break;

            }

        }

    }

    ProgressDiv.innerHTML+="."

    var RevsWithoutMapsSection = JSON.parse(

        $.ajax({

            dataType: "json",

            url: mw.util.wikiScript('api'),

            data: {

                format: 'json',

                action: 'query',

                rawcontinue: 'true',

                prop: 'revisions',

                rvprop: 'timestamp|comment|content',

                rvlimit: 'max',

                rvstartid: '568219687',

                rvendid: '554210647',

                rvsection: '1',

                titles: 'Wikipedia:WikiProject National Register of Historic Places/Progress'

            },

            async:false

        })

        .responseText

    );

    for (var r in RevsWithoutMapsSection.query.pages"38959189"].revisions) {

        if (RevsWithoutMapsSection.query.pages"38959189"].revisionsr].comment.indexOf("Updating county data as of ")>-1) {

            UpdatesUpdates.length = RevsWithoutMapsSection.query.pages"38959189"].revisionsr].timestamp,RevsWithoutMapsSection.query.pages"38959189"].revisionsr]["*"]]

        }

    }

    if (RevsWithoutMapsSection"query-continue"]) {

        var rvcontinue = RevsWithoutMapsSection"query-continue"].revisions.rvcontinue

        while (true) {

            ProgressDiv.innerHTML+="."

            var RevsWithoutMapsSection = JSON.parse(

                $.ajax({

                    dataType: "json",

                    url: mw.util.wikiScript('api'),

                    data: {

                        format: 'json',

                        rawcontinue: 'true',

                        action: 'query',

                        prop: 'revisions',

                        rvprop: 'timestamp|comment|content',

                        rvlimit: 'max',

                        rvstartid: '568219687',

                        rvendid: '554210647',

                        rvcontinue: rvcontinue,

                        rvsection: '1',

                        titles: 'Wikipedia:WikiProject National Register of Historic Places/Progress'

                    },

                    async:false

                })

                .responseText

            );

            for (var r in RevsWithoutMapsSection.query.pages"38959189"].revisions) {

                if (RevsWithoutMapsSection.query.pages"38959189"].revisionsr].comment.indexOf("Updating county data as of ")>-1) {

                    UpdatesUpdates.length = RevsWithoutMapsSection.query.pages"38959189"].revisionsr].timestamp,RevsWithoutMapsSection.query.pages"38959189"].revisionsr]["*"]]

                }

            }

            if (RevsWithoutMapsSection"query-continue"]) {

                rvcontinue = RevsWithoutMapsSection"query-continue"].revisions.rvcontinue

            } else {

                break;

            }

        }

    }

    ProgressDiv.innerHTML+="Done!<br>Compiling data..."

    for (var i=0; i<Updates.length; i++) {

        if (Updatesi][0=="2013-05-23T07:37:05Z"||Updatesi][0=="2013-05-23T07:32:15Z"||Updatesi][0=="2013-10-14T01:15:21Z"||Updatesi][0=="2013-05-29T07:14:43Z") {Updates.splice(i,1); i--; continue}   // get rid of error/test updates

        var thisrevtext=Updatesi][1

        Updatesi][1=[];

        Updatesi][1][0=thisrevtext.match(/Total:(.|\n)*?\|}/g)[0].replace(/\n/g,"").replace(/!/g,"|")

        for (var j=0; j<StatesArray.length; j++) {

            var regex=new RegExp("\\|[ ]*?(\\[\\[)?.*?"+StatesArrayj][0+"(\\]\\])?[ ]*?\\n(.|\\n)*?\\|--", "g")

            Updatesi][1][Updatesi][1].length=thisrevtext.match(regex)[0

            regex=new RegExp("\\|[ ]*?(\\[\\[)?.*?"+StatesArrayj][0+"(\\]\\])?[ ]*?\\n", "g")

            Updatesi][1][Updatesi][1].length-1=Updatesi][1][Updatesi][1].length-1].replace(regex,"").replace(/\n/g,"")    // drop state name

        }

        var d=new Date(Updatesi][0]);

        var timestampstr=d.getUTCFullYear().toString()

        var month=parseFloat(d.getUTCMonth()+1).toString()

        if (month.length<2) month="0"+month

        timestampstr+=month

        var day=d.getUTCDate().toString()

        if (day.length<2) day="0"+day

        timestampstr+=day

        Updatesi][0=timestampstr

    }



    wikitext+='<textarea style="width: 100%; height: 300px" onclick="this.focus();this.select()" wrap="off">\n# 1 Date            2 Total             3 Illustrated       4 %Illustrated      5 Articled          6 %Articled         7 Stubs             8 NRIS-only         9 Start+            10 %Start+          11 Unassessed       12 Untagged         13 Net_Quality      '

    var currentColumn=14

    for (var i=0; i<StatesArray.length; i++) {

        wikitext+=currentColumn+' '+StatesArrayi][1+'_Total        '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_Illustrated  '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_%Illustrated '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_Articled     '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_%Articled    '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_Stubs        '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_NRIS-only    '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_Start+       '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_%Start+      '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_Unassessed   '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_Untagged     '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_Net_Quality  '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

    }

    wikitext+='\n'

    for (var i=0; i<Updates.length; i++) {

        wikitext+=Updatesi][0+"            "

        for (var j=0; j<Updatesi][1].length; j++) {

            // Total

            wikitext+=Updatesi][1][j].split("|")[1].replace(/,/g,"").trim()

            for (var k=0; k<20-Updatesi][1][j].split("|")[1].replace(/,/g,"").trim().length; k++) {wikitext+=" "}



            // Illustrated

            wikitext+=Updatesi][1][j].split("|")[2].replace(/,/g,"").trim()

            for (var k=0; k<20-Updatesi][1][j].split("|")[2].replace(/,/g,"").trim().length; k++) {wikitext+=" "}



            // %Illustrated

            wikitext+=Updatesi][1][j].split("|")[3].replace(/%/g,"").trim()

            for (var k=0; k<20-Updatesi][1][j].split("|")[3].replace(/%/g,"").trim().length; k++) {wikitext+=" "}



            // Articled

            wikitext+=Updatesi][1][j].split("|")[4].replace(/,/g,"").trim()

            for (var k=0; k<20-Updatesi][1][j].split("|")[4].replace(/,/g,"").trim().length; k++) {wikitext+=" "}



            // %Articled

            wikitext+=Updatesi][1][j].split("|")[5].replace(/%/g,"").trim()

            for (var k=0; k<20-Updatesi][1][j].split("|")[5].replace(/%/g,"").trim().length; k++) {wikitext+=" "}



            // Stubs

            if (parseFloat(Updatesi][0])>=20130901) {

                wikitext+=Updatesi][1][j].split("|")[6].replace(/,/g,"").trim()

                if (Updatesi][1][j].split("|")[6].replace(/,/g,"").trim().length==0) {

                    wikitext+="-"

                } else {

                    wikitext+=" "

                }

                for (var k=0; k<19-Updatesi][1][j].split("|")[6].replace(/,/g,"").trim().length; k++) {wikitext+=" "}

            } else {

                wikitext+="-                   "

            }



            // NRIS-only

            if (parseFloat(Updatesi][0])>20131120) {

                if (parseFloat(Updatesi][0])==20131121) {

                    wikitext+="-                   "

                } else {

                    wikitext+=Updatesi][1][j].split("|")[7].replace(/,/g,"").trim()

                    if (Updatesi][1][j].split("|")[7].replace(/,/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                    for (var k=0; k<19-Updatesi][1][j].split("|")[7].replace(/,/g,"").trim().length; k++) {wikitext+=" "}

                }

            } else {

                wikitext+="-                   "

            }



            // Start+

            if (parseFloat(Updatesi][0])>=20130901) {

                if (parseFloat(Updatesi][0])>20131120) {

                    wikitext+=Updatesi][1][j].split("|")[8].replace(/,/g,"").trim()

                    if (Updatesi][1][j].split("|")[8].replace(/,/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                    for (var k=0; k<19-Updatesi][1][j].split("|")[8].replace(/,/g,"").trim().length; k++) {wikitext+=" "}

                } else {

                    wikitext+=Updatesi][1][j].split("|")[7].replace(/,/g,"").trim()

                    if (Updatesi][1][j].split("|")[7].replace(/,/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                    for (var k=0; k<19-Updatesi][1][j].split("|")[7].replace(/,/g,"").trim().length; k++) {wikitext+=" "}

                }

            } else {

                wikitext+="-                   "

            }



            // %Start+

            if (parseFloat(Updatesi][0])>=20130901) {

                if (parseFloat(Updatesi][0])>20131120) {

                    wikitext+=Updatesi][1][j].split("|")[9].replace(/%/g,"").trim()

                    if (Updatesi][1][j].split("|")[9].replace(/%/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                    for (var k=0; k<19-Updatesi][1][j].split("|")[9].replace(/%/g,"").trim().length; k++) {wikitext+=" "}

                } else {

                    wikitext+=Updatesi][1][j].split("|")[8].replace(/%/g,"").trim()

                    if (Updatesi][1][j].split("|")[8].replace(/%/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                    for (var k=0; k<19-Updatesi][1][j].split("|")[8].replace(/%/g,"").trim().length; k++) {wikitext+=" "}

                }

            } else {

                wikitext+="-                   "

            }



            // Unassessed

            if (parseFloat(Updatesi][0])>=20130901) {

                if (parseFloat(Updatesi][0])>20131120) {

                    wikitext+=Updatesi][1][j].split("|")[10].replace(/,/g,"").trim()

                    if (Updatesi][1][j].split("|")[10].replace(/,/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                    for (var k=0; k<19-Updatesi][1][j].split("|")[10].replace(/,/g,"").trim().length; k++) {wikitext+=" "}

                } else {

                    wikitext+=Updatesi][1][j].split("|")[9].replace(/,/g,"").trim()

                    if (Updatesi][1][j].split("|")[9].replace(/,/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                    for (var k=0; k<19-Updatesi][1][j].split("|")[9].replace(/,/g,"").trim().length; k++) {wikitext+=" "}

                }

            } else {

                wikitext+="-                   "

            }



            // Untagged

            if (parseFloat(Updatesi][0])>=20130901) {

                if (parseFloat(Updatesi][0])>20131120) {

                    wikitext+=Updatesi][1][j].split("|")[11].replace(/,/g,"").trim()

                    if (Updatesi][1][j].split("|")[11].replace(/,/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                    for (var k=0; k<19-Updatesi][1][j].split("|")[11].replace(/,/g,"").trim().length; k++) {wikitext+=" "}

                } else {

                    wikitext+=Updatesi][1][j].split("|")[10].replace(/,/g,"").trim()

                    if (Updatesi][1][j].split("|")[10].replace(/,/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                    for (var k=0; k<19-Updatesi][1][j].split("|")[10].replace(/,/g,"").trim().length; k++) {wikitext+=" "}

                }

            } else {

                wikitext+="-                   "

            }



            // Net Quality

            if (parseFloat(Updatesi][0])>20131121) {

                wikitext+=Updatesi][1][j].split("|")[12].replace(/%/g,"").trim()

                    if (Updatesi][1][j].split("|")[12].replace(/%/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                for (var k=0; k<19-Updatesi][1][j].split("|")[12].replace(/%/g,"").trim().length; k++) {wikitext+=" "}

            } else {

                wikitext+="-                   "

            }



        }

        wikitext+="\n"

    }

    wikitext+='</textarea>\n\n'



    ProgressDiv.innerHTML+="Done!<br>Querying FA/GA stats"

    var FA_Updates = [];

    var GA_Updates = [];

    ProgressDiv.innerHTML+="."

    var FA_Revs = JSON.parse(

        $.ajax({

            dataType: "json",

            url: mw.util.wikiScript('api'),

            data: {

                format: 'json',

                rawcontinue: 'true',

                action: 'query',

                prop: 'revisions',

                rvprop: 'timestamp|user|content',

                rvlimit: 'max',

                rvuser: 'JL-Bot',

                titles: 'Wikipedia:WikiProject National Register of Historic Places/Recognized content'

            },

            async:false

        })

        .responseText

    );

    for (var r in FA_Revs.query.pages"32792745"].revisions) {

        if (FA_Revs.query.pages"32792745"].revisionsr].timestamp,FA_Revs.query.pages"32792745"].revisionsr]["timestamp"!="2015-05-10T17:12:52Z") {

            FA_UpdatesFA_Updates.length = FA_Revs.query.pages"32792745"].revisionsr].timestamp,FA_Revs.query.pages"32792745"].revisionsr]["*"]]

        }

    }

    if (FA_Revs"query-continue"]) {

        var rvcontinue = FA_Revs"query-continue"].revisions.rvcontinue

        while (true) {

            ProgressDiv.innerHTML+="."

            var FA_Revs = JSON.parse(

                $.ajax({

                    dataType: "json",

                    url: mw.util.wikiScript('api'),

                    data: {

                        format: 'json',

                        rawcontinue: 'true',

                        action: 'query',

                        prop: 'revisions',

                        rvprop: 'timestamp|user|content',

                        rvlimit: 'max',

                        rvcontinue: rvcontinue,

                        rvuser: 'JL-Bot',

                        titles: 'Wikipedia:WikiProject National Register of Historic Places/Recognized content'

                    },

                    async:false

                })

                .responseText

            );

            for (var r in FA_Revs.query.pages"32792745"].revisions) {

                if (FA_Revs.query.pages"32792745"].revisionsr].timestamp,FA_Revs.query.pages"32792745"].revisionsr]["timestamp"!="2015-05-10T17:12:52Z") {

                    FA_UpdatesFA_Updates.length = FA_Revs.query.pages"32792745"].revisionsr].timestamp,FA_Revs.query.pages"32792745"].revisionsr]["*"]]

                }

            }

            if (FA_Revs"query-continue"]) {

                rvcontinue = FA_Revs"query-continue"].revisions.rvcontinue

            } else {

                break;

            }

        }

    }

    ProgressDiv.innerHTML+="."

    var GA_Revs = JSON.parse(

        $.ajax({

            dataType: "json",

            url: mw.util.wikiScript('api'),

            data: {

                format: 'json',

                rawcontinue: 'true',

                action: 'query',

                prop: 'revisions',

                rvprop: 'timestamp|user|content',

                rvlimit: 'max',

                rvuser: 'JL-Bot',

                titles: 'Wikipedia:WikiProject National Register of Historic Places/GA'

            },

            async:false

        })

        .responseText

    );

    for (var r in GA_Revs.query.pages"32766443"].revisions) {

        if (GA_Revs.query.pages"32766443"].revisionsr].timestamp,GA_Revs.query.pages"32766443"].revisionsr]["timestamp"!="2015-05-10T17:12:45Z") {

            GA_UpdatesGA_Updates.length = GA_Revs.query.pages"32766443"].revisionsr].timestamp,GA_Revs.query.pages"32766443"].revisionsr]["*"]]

        }

    }

    if (GA_Revs"query-continue"]) {

        var rvcontinue = GA_Revs"query-continue"].revisions.rvcontinue

        while (true) {

            ProgressDiv.innerHTML+="."

            var GA_Revs = JSON.parse(

                $.ajax({

                    dataType: "json",

                    url: mw.util.wikiScript('api'),

                    data: {

                        format: 'json',

                        rawcontinue: 'true',

                        action: 'query',

                        prop: 'revisions',

                        rvprop: 'timestamp|user|content',

                        rvlimit: 'max',

                        rvcontinue: rvcontinue,

                        rvuser: 'JL-Bot',

                        titles: 'Wikipedia:WikiProject National Register of Historic Places/GA'

                    },

                    async:false

                })

                .responseText

            );

            for (var r in GA_Revs.query.pages"32766443"].revisions) {

                if (GA_Revs.query.pages"32766443"].revisionsr].timestamp,GA_Revs.query.pages"32766443"].revisionsr]["timestamp"!="2015-05-10T17:12:45Z") {

                    GA_UpdatesGA_Updates.length = GA_Revs.query.pages"32766443"].revisionsr].timestamp,GA_Revs.query.pages"32766443"].revisionsr]["*"]]

                }

            }

            if (GA_Revs"query-continue"]) {

                rvcontinue = GA_Revs"query-continue"].revisions.rvcontinue

            } else {

                break;

            }

        }

    }

    for (var i=0; i<FA_Updates.length; i++) {

        if (FA_Updatesi][0=="2014-06-28T18:12:43Z") {FA_Updates.splice(i,1); i--; continue}   // get rid of error/test updates

        var thisrevtext=FA_Updatesi][1

        var str="==={{Icon|FA}} Featured articles==="

        var FASectionBegin = thisrevtext.indexOf(str)

        thisrevtext=thisrevtext.substr(FASectionBegin,thisrevtext.indexOf("===",FASectionBegin+str.length)-FASectionBegin)

        FA_Updatesi][1=thisrevtext.match(/\[\[.*?\]\]/g).length



        var d=new Date(FA_Updatesi][0]);

        var timestampstr=d.getUTCFullYear().toString()

        var month=parseFloat(d.getUTCMonth()+1).toString()

        if (month.length<2) month="0"+month

        timestampstr+=month

        var day=d.getUTCDate().toString()

        if (day.length<2) day="0"+day

        timestampstr+=day

        FA_Updatesi][0=timestampstr

    }

    for (var i=0; i<GA_Updates.length; i++) {

        if (GA_Updatesi][0=="2014-06-28T18:12:26Z") {GA_Updates.splice(i,1); i--; continue}   // get rid of error/test updates

        var thisrevtext=GA_Updatesi][1

        GA_Updatesi][1=thisrevtext.match(/\[\[.*?\]\]/g).length



        var d=new Date(GA_Updatesi][0]);

        var timestampstr=d.getUTCFullYear().toString()

        var month=parseFloat(d.getUTCMonth()+1).toString()

        if (month.length<2) month="0"+month

        timestampstr+=month

        var day=d.getUTCDate().toString()

        if (day.length<2) day="0"+day

        timestampstr+=day

        GA_Updatesi][0=timestampstr

    }



    wikitext+='<textarea style="width: 100%; height: 300px" onclick="this.focus();this.select()" wrap="off">\n# 1 Date    2 FA_Count  3 Date      4 GA_Count  \n'

    for (var i=0; i<FA_Updates.length; i++) {

        wikitext+=FA_Updatesi][0+"    "+FA_Updatesi][1

        for (var k=0; k<12-FA_Updatesi][1].toString().length; k++) {wikitext+=" "}

        if (i<GA_Updates.length) wikitext+=GA_Updatesi][0+"    "+GA_Updatesi][1

        wikitext+="\n"

    }

    wikitext+='</textarea>\n\n'



    ProgressDiv.innerHTML+="Done! The results will now pop up in a new tab for copying."

    setTimeout(DumpData(wikitext), 5000);

}



function DumpData(wikitext) {

    var popup = open("");

    var div = popup.document.createElement("div");

    div.innerHTML=wikitext

    popup.document.body.appendChild(div);

}



$(ProgressPageHistoryButton)
From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.

/* The following code produces the data found at [[Wikipedia:WikiProject National Register of Historic Places/Progress/History]]

   by looking back through old revisions of the [[WP:NRHPPROGRESS]] page. The data can then be used to create graphs

*/



var StatesArray=

    "Alabama","AL"],

    "Alaska","AK"],

    "Arizona","AZ"],

    "Arkansas","AR"],

    "California","CA"],

    "Colorado","CO"],

    "Connecticut","CT"],

    "Delaware","DE"],

    "District of Columbia","DC"],

    "Florida","FL"],

    "Georgia","GA"],

    "Hawaii","HI"],

    "Idaho","ID"],

    "Illinois","IL"],

    "Indiana","IN"],

    "Iowa","IA"],

    "Kansas","KS"],

    "Kentucky","KY"],

    "Louisiana","LA"],

    "Maine","ME"],

    "Maryland","MD"],

    "Massachusetts","MA"],

    "Michigan","MI"],

    "Minnesota","MN"],

    "Mississippi","MS"],

    "Missouri","MO"],

    "Montana","MT"],

    "Nebraska","NE"],

    "Nevada","NV"],

    "New Hampshire","NH"],

    "New Jersey","NJ"],

    "New Mexico","NM"],

    "New York","NY"],

    "North Carolina","NC"],

    "North Dakota","ND"],

    "Ohio","OH"],

    "Oklahoma","OK"],

    "Oregon","OR"],

    "Pennsylvania","PA"],

    "Rhode Island","RI"],

    "South Carolina","SC"],

    "South Dakota","SD"],

    "Tennessee","TN"],

    "Texas","TX"],

    "Utah","UT"],

    "Vermont","VT"],

    "Virginia","VA"],

    "Washington","WA"],

    "West Virginia","WV"],

    "Wisconsin","WI"],

    "Wyoming","WY"],

    "Puerto Rico","PR"],

    "Guam","GU"],

    "Virgin Islands","VI"],

    "Northern Mariana Islands","MP"],

    "American Samoa","AS"],

    "Federated States of Micronesia","FM"],

    "Palau","PW"],

    "Marshall Islands","MH"],

    "Minor Outlying Islands","UM"],

    ];



function ProgressPageHistoryButton() {

    if (mw.config.get('wgPageName')!="Wikipedia:WikiProject_National_Register_of_Historic_Places/Progress/History") return

    var button=document.createElement("input")

    button.setAttribute("type", "button");

    button.setAttribute("value", "Get Progress Page History");

    button.setAttribute("id", "historybutton");

    button.setAttribute("onclick", "HistoryButtonClick()");

    var content=document.getElementById('mw-content-text')



    content.parentNode.insertBefore(button, content)

}





function HistoryButtonClick() {

    var button=document.getElementById("historybutton")

    button.value="Working..."

    button.disabled=true



    var ProgressDiv = document.createElement('div')

    ProgressDiv.setAttribute('id', 'ProgressDiv')

    ProgressDiv.setAttribute("style", "width:500px; border:1px solid black; padding:5px")

    button.parentNode.insertBefore(ProgressDiv, button)

    ProgressDiv.innerHTML = "Querying old edits"

    GetProgressPageHistory()

}



function GetProgressPageHistory() {

    var ProgressDiv = document.getElementById("ProgressDiv")



    var Updates = [];

    var wikitext = ''

    ProgressDiv.innerHTML+="."



    var RevsWithMapsSection = JSON.parse(

        $.ajax({

            dataType: "json",

            url: mw.util.wikiScript('api'),

            data: {

                format: 'json',

                rawcontinue: 'true',

                action: 'query',

                prop: 'revisions',

                rvprop: 'timestamp|comment|content',

                rvlimit: 'max',

                rvendid: '568713090',

                rvsection: '2',

                titles: 'Wikipedia:WikiProject National Register of Historic Places/Progress'

            },

            async:false

        })

        .responseText

    );

    for (var r in RevsWithMapsSection.query.pages"38959189"].revisions) {

        if (RevsWithMapsSection.query.pages"38959189"].revisionsr].comment.indexOf("Updating county data as of ")>-1) {

            UpdatesUpdates.length = RevsWithMapsSection.query.pages"38959189"].revisionsr].timestamp,RevsWithMapsSection.query.pages"38959189"].revisionsr]["*"]]

        }

    }

    if (RevsWithMapsSection"query-continue"]) {

        var rvcontinue = RevsWithMapsSection"query-continue"].revisions.rvcontinue

        while (true) {

            ProgressDiv.innerHTML+="."

            var RevsWithMapsSection = JSON.parse(

                $.ajax({

                    dataType: "json",

                    url: mw.util.wikiScript('api'),

                    data: {

                        format: 'json',

                        action: 'query',

                        prop: 'revisions',

                        rvprop: 'timestamp|comment|content',

                        rvlimit: 'max',

                        rvcontinue: rvcontinue,

                        rawcontinue: 'true',

                        rvendid: '568713090',

                        rvsection: '2',

                        titles: 'Wikipedia:WikiProject National Register of Historic Places/Progress'

                    },

                    async:false

                })

                .responseText

            );

            for (var r in RevsWithMapsSection.query.pages"38959189"].revisions) {

                if (RevsWithMapsSection.query.pages"38959189"].revisionsr].comment.indexOf("Updating county data as of ")>-1) {

                    UpdatesUpdates.length = RevsWithMapsSection.query.pages"38959189"].revisionsr].timestamp,RevsWithMapsSection.query.pages"38959189"].revisionsr]["*"]]

                }

            }

            if (RevsWithMapsSection"query-continue"]) {

                rvcontinue = RevsWithMapsSection"query-continue"].revisions.rvcontinue

            } else {

                break;

            }

        }

    }

    ProgressDiv.innerHTML+="."

    var RevsWithoutMapsSection = JSON.parse(

        $.ajax({

            dataType: "json",

            url: mw.util.wikiScript('api'),

            data: {

                format: 'json',

                action: 'query',

                rawcontinue: 'true',

                prop: 'revisions',

                rvprop: 'timestamp|comment|content',

                rvlimit: 'max',

                rvstartid: '568219687',

                rvendid: '554210647',

                rvsection: '1',

                titles: 'Wikipedia:WikiProject National Register of Historic Places/Progress'

            },

            async:false

        })

        .responseText

    );

    for (var r in RevsWithoutMapsSection.query.pages"38959189"].revisions) {

        if (RevsWithoutMapsSection.query.pages"38959189"].revisionsr].comment.indexOf("Updating county data as of ")>-1) {

            UpdatesUpdates.length = RevsWithoutMapsSection.query.pages"38959189"].revisionsr].timestamp,RevsWithoutMapsSection.query.pages"38959189"].revisionsr]["*"]]

        }

    }

    if (RevsWithoutMapsSection"query-continue"]) {

        var rvcontinue = RevsWithoutMapsSection"query-continue"].revisions.rvcontinue

        while (true) {

            ProgressDiv.innerHTML+="."

            var RevsWithoutMapsSection = JSON.parse(

                $.ajax({

                    dataType: "json",

                    url: mw.util.wikiScript('api'),

                    data: {

                        format: 'json',

                        rawcontinue: 'true',

                        action: 'query',

                        prop: 'revisions',

                        rvprop: 'timestamp|comment|content',

                        rvlimit: 'max',

                        rvstartid: '568219687',

                        rvendid: '554210647',

                        rvcontinue: rvcontinue,

                        rvsection: '1',

                        titles: 'Wikipedia:WikiProject National Register of Historic Places/Progress'

                    },

                    async:false

                })

                .responseText

            );

            for (var r in RevsWithoutMapsSection.query.pages"38959189"].revisions) {

                if (RevsWithoutMapsSection.query.pages"38959189"].revisionsr].comment.indexOf("Updating county data as of ")>-1) {

                    UpdatesUpdates.length = RevsWithoutMapsSection.query.pages"38959189"].revisionsr].timestamp,RevsWithoutMapsSection.query.pages"38959189"].revisionsr]["*"]]

                }

            }

            if (RevsWithoutMapsSection"query-continue"]) {

                rvcontinue = RevsWithoutMapsSection"query-continue"].revisions.rvcontinue

            } else {

                break;

            }

        }

    }

    ProgressDiv.innerHTML+="Done!<br>Compiling data..."

    for (var i=0; i<Updates.length; i++) {

        if (Updatesi][0=="2013-05-23T07:37:05Z"||Updatesi][0=="2013-05-23T07:32:15Z"||Updatesi][0=="2013-10-14T01:15:21Z"||Updatesi][0=="2013-05-29T07:14:43Z") {Updates.splice(i,1); i--; continue}   // get rid of error/test updates

        var thisrevtext=Updatesi][1

        Updatesi][1=[];

        Updatesi][1][0=thisrevtext.match(/Total:(.|\n)*?\|}/g)[0].replace(/\n/g,"").replace(/!/g,"|")

        for (var j=0; j<StatesArray.length; j++) {

            var regex=new RegExp("\\|[ ]*?(\\[\\[)?.*?"+StatesArrayj][0+"(\\]\\])?[ ]*?\\n(.|\\n)*?\\|--", "g")

            Updatesi][1][Updatesi][1].length=thisrevtext.match(regex)[0

            regex=new RegExp("\\|[ ]*?(\\[\\[)?.*?"+StatesArrayj][0+"(\\]\\])?[ ]*?\\n", "g")

            Updatesi][1][Updatesi][1].length-1=Updatesi][1][Updatesi][1].length-1].replace(regex,"").replace(/\n/g,"")    // drop state name

        }

        var d=new Date(Updatesi][0]);

        var timestampstr=d.getUTCFullYear().toString()

        var month=parseFloat(d.getUTCMonth()+1).toString()

        if (month.length<2) month="0"+month

        timestampstr+=month

        var day=d.getUTCDate().toString()

        if (day.length<2) day="0"+day

        timestampstr+=day

        Updatesi][0=timestampstr

    }



    wikitext+='<textarea style="width: 100%; height: 300px" onclick="this.focus();this.select()" wrap="off">\n# 1 Date            2 Total             3 Illustrated       4 %Illustrated      5 Articled          6 %Articled         7 Stubs             8 NRIS-only         9 Start+            10 %Start+          11 Unassessed       12 Untagged         13 Net_Quality      '

    var currentColumn=14

    for (var i=0; i<StatesArray.length; i++) {

        wikitext+=currentColumn+' '+StatesArrayi][1+'_Total        '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_Illustrated  '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_%Illustrated '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_Articled     '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_%Articled    '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_Stubs        '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_NRIS-only    '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_Start+       '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_%Start+      '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_Unassessed   '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_Untagged     '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

        wikitext+=currentColumn+' '+StatesArrayi][1+'_Net_Quality  '

        if (currentColumn<100) wikitext+=' '

        currentColumn++

    }

    wikitext+='\n'

    for (var i=0; i<Updates.length; i++) {

        wikitext+=Updatesi][0+"            "

        for (var j=0; j<Updatesi][1].length; j++) {

            // Total

            wikitext+=Updatesi][1][j].split("|")[1].replace(/,/g,"").trim()

            for (var k=0; k<20-Updatesi][1][j].split("|")[1].replace(/,/g,"").trim().length; k++) {wikitext+=" "}



            // Illustrated

            wikitext+=Updatesi][1][j].split("|")[2].replace(/,/g,"").trim()

            for (var k=0; k<20-Updatesi][1][j].split("|")[2].replace(/,/g,"").trim().length; k++) {wikitext+=" "}



            // %Illustrated

            wikitext+=Updatesi][1][j].split("|")[3].replace(/%/g,"").trim()

            for (var k=0; k<20-Updatesi][1][j].split("|")[3].replace(/%/g,"").trim().length; k++) {wikitext+=" "}



            // Articled

            wikitext+=Updatesi][1][j].split("|")[4].replace(/,/g,"").trim()

            for (var k=0; k<20-Updatesi][1][j].split("|")[4].replace(/,/g,"").trim().length; k++) {wikitext+=" "}



            // %Articled

            wikitext+=Updatesi][1][j].split("|")[5].replace(/%/g,"").trim()

            for (var k=0; k<20-Updatesi][1][j].split("|")[5].replace(/%/g,"").trim().length; k++) {wikitext+=" "}



            // Stubs

            if (parseFloat(Updatesi][0])>=20130901) {

                wikitext+=Updatesi][1][j].split("|")[6].replace(/,/g,"").trim()

                if (Updatesi][1][j].split("|")[6].replace(/,/g,"").trim().length==0) {

                    wikitext+="-"

                } else {

                    wikitext+=" "

                }

                for (var k=0; k<19-Updatesi][1][j].split("|")[6].replace(/,/g,"").trim().length; k++) {wikitext+=" "}

            } else {

                wikitext+="-                   "

            }



            // NRIS-only

            if (parseFloat(Updatesi][0])>20131120) {

                if (parseFloat(Updatesi][0])==20131121) {

                    wikitext+="-                   "

                } else {

                    wikitext+=Updatesi][1][j].split("|")[7].replace(/,/g,"").trim()

                    if (Updatesi][1][j].split("|")[7].replace(/,/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                    for (var k=0; k<19-Updatesi][1][j].split("|")[7].replace(/,/g,"").trim().length; k++) {wikitext+=" "}

                }

            } else {

                wikitext+="-                   "

            }



            // Start+

            if (parseFloat(Updatesi][0])>=20130901) {

                if (parseFloat(Updatesi][0])>20131120) {

                    wikitext+=Updatesi][1][j].split("|")[8].replace(/,/g,"").trim()

                    if (Updatesi][1][j].split("|")[8].replace(/,/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                    for (var k=0; k<19-Updatesi][1][j].split("|")[8].replace(/,/g,"").trim().length; k++) {wikitext+=" "}

                } else {

                    wikitext+=Updatesi][1][j].split("|")[7].replace(/,/g,"").trim()

                    if (Updatesi][1][j].split("|")[7].replace(/,/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                    for (var k=0; k<19-Updatesi][1][j].split("|")[7].replace(/,/g,"").trim().length; k++) {wikitext+=" "}

                }

            } else {

                wikitext+="-                   "

            }



            // %Start+

            if (parseFloat(Updatesi][0])>=20130901) {

                if (parseFloat(Updatesi][0])>20131120) {

                    wikitext+=Updatesi][1][j].split("|")[9].replace(/%/g,"").trim()

                    if (Updatesi][1][j].split("|")[9].replace(/%/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                    for (var k=0; k<19-Updatesi][1][j].split("|")[9].replace(/%/g,"").trim().length; k++) {wikitext+=" "}

                } else {

                    wikitext+=Updatesi][1][j].split("|")[8].replace(/%/g,"").trim()

                    if (Updatesi][1][j].split("|")[8].replace(/%/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                    for (var k=0; k<19-Updatesi][1][j].split("|")[8].replace(/%/g,"").trim().length; k++) {wikitext+=" "}

                }

            } else {

                wikitext+="-                   "

            }



            // Unassessed

            if (parseFloat(Updatesi][0])>=20130901) {

                if (parseFloat(Updatesi][0])>20131120) {

                    wikitext+=Updatesi][1][j].split("|")[10].replace(/,/g,"").trim()

                    if (Updatesi][1][j].split("|")[10].replace(/,/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                    for (var k=0; k<19-Updatesi][1][j].split("|")[10].replace(/,/g,"").trim().length; k++) {wikitext+=" "}

                } else {

                    wikitext+=Updatesi][1][j].split("|")[9].replace(/,/g,"").trim()

                    if (Updatesi][1][j].split("|")[9].replace(/,/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                    for (var k=0; k<19-Updatesi][1][j].split("|")[9].replace(/,/g,"").trim().length; k++) {wikitext+=" "}

                }

            } else {

                wikitext+="-                   "

            }



            // Untagged

            if (parseFloat(Updatesi][0])>=20130901) {

                if (parseFloat(Updatesi][0])>20131120) {

                    wikitext+=Updatesi][1][j].split("|")[11].replace(/,/g,"").trim()

                    if (Updatesi][1][j].split("|")[11].replace(/,/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                    for (var k=0; k<19-Updatesi][1][j].split("|")[11].replace(/,/g,"").trim().length; k++) {wikitext+=" "}

                } else {

                    wikitext+=Updatesi][1][j].split("|")[10].replace(/,/g,"").trim()

                    if (Updatesi][1][j].split("|")[10].replace(/,/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                    for (var k=0; k<19-Updatesi][1][j].split("|")[10].replace(/,/g,"").trim().length; k++) {wikitext+=" "}

                }

            } else {

                wikitext+="-                   "

            }



            // Net Quality

            if (parseFloat(Updatesi][0])>20131121) {

                wikitext+=Updatesi][1][j].split("|")[12].replace(/%/g,"").trim()

                    if (Updatesi][1][j].split("|")[12].replace(/%/g,"").trim().length==0) {

                        wikitext+="-"

                    } else {

                        wikitext+=" "

                    }

                for (var k=0; k<19-Updatesi][1][j].split("|")[12].replace(/%/g,"").trim().length; k++) {wikitext+=" "}

            } else {

                wikitext+="-                   "

            }



        }

        wikitext+="\n"

    }

    wikitext+='</textarea>\n\n'



    ProgressDiv.innerHTML+="Done!<br>Querying FA/GA stats"

    var FA_Updates = [];

    var GA_Updates = [];

    ProgressDiv.innerHTML+="."

    var FA_Revs = JSON.parse(

        $.ajax({

            dataType: "json",

            url: mw.util.wikiScript('api'),

            data: {

                format: 'json',

                rawcontinue: 'true',

                action: 'query',

                prop: 'revisions',

                rvprop: 'timestamp|user|content',

                rvlimit: 'max',

                rvuser: 'JL-Bot',

                titles: 'Wikipedia:WikiProject National Register of Historic Places/Recognized content'

            },

            async:false

        })

        .responseText

    );

    for (var r in FA_Revs.query.pages"32792745"].revisions) {

        if (FA_Revs.query.pages"32792745"].revisionsr].timestamp,FA_Revs.query.pages"32792745"].revisionsr]["timestamp"!="2015-05-10T17:12:52Z") {

            FA_UpdatesFA_Updates.length = FA_Revs.query.pages"32792745"].revisionsr].timestamp,FA_Revs.query.pages"32792745"].revisionsr]["*"]]

        }

    }

    if (FA_Revs"query-continue"]) {

        var rvcontinue = FA_Revs"query-continue"].revisions.rvcontinue

        while (true) {

            ProgressDiv.innerHTML+="."

            var FA_Revs = JSON.parse(

                $.ajax({

                    dataType: "json",

                    url: mw.util.wikiScript('api'),

                    data: {

                        format: 'json',

                        rawcontinue: 'true',

                        action: 'query',

                        prop: 'revisions',

                        rvprop: 'timestamp|user|content',

                        rvlimit: 'max',

                        rvcontinue: rvcontinue,

                        rvuser: 'JL-Bot',

                        titles: 'Wikipedia:WikiProject National Register of Historic Places/Recognized content'

                    },

                    async:false

                })

                .responseText

            );

            for (var r in FA_Revs.query.pages"32792745"].revisions) {

                if (FA_Revs.query.pages"32792745"].revisionsr].timestamp,FA_Revs.query.pages"32792745"].revisionsr]["timestamp"!="2015-05-10T17:12:52Z") {

                    FA_UpdatesFA_Updates.length = FA_Revs.query.pages"32792745"].revisionsr].timestamp,FA_Revs.query.pages"32792745"].revisionsr]["*"]]

                }

            }

            if (FA_Revs"query-continue"]) {

                rvcontinue = FA_Revs"query-continue"].revisions.rvcontinue

            } else {

                break;

            }

        }

    }

    ProgressDiv.innerHTML+="."

    var GA_Revs = JSON.parse(

        $.ajax({

            dataType: "json",

            url: mw.util.wikiScript('api'),

            data: {

                format: 'json',

                rawcontinue: 'true',

                action: 'query',

                prop: 'revisions',

                rvprop: 'timestamp|user|content',

                rvlimit: 'max',

                rvuser: 'JL-Bot',

                titles: 'Wikipedia:WikiProject National Register of Historic Places/GA'

            },

            async:false

        })

        .responseText

    );

    for (var r in GA_Revs.query.pages"32766443"].revisions) {

        if (GA_Revs.query.pages"32766443"].revisionsr].timestamp,GA_Revs.query.pages"32766443"].revisionsr]["timestamp"!="2015-05-10T17:12:45Z") {

            GA_UpdatesGA_Updates.length = GA_Revs.query.pages"32766443"].revisionsr].timestamp,GA_Revs.query.pages"32766443"].revisionsr]["*"]]

        }

    }

    if (GA_Revs"query-continue"]) {

        var rvcontinue = GA_Revs"query-continue"].revisions.rvcontinue

        while (true) {

            ProgressDiv.innerHTML+="."

            var GA_Revs = JSON.parse(

                $.ajax({

                    dataType: "json",

                    url: mw.util.wikiScript('api'),

                    data: {

                        format: 'json',

                        rawcontinue: 'true',

                        action: 'query',

                        prop: 'revisions',

                        rvprop: 'timestamp|user|content',

                        rvlimit: 'max',

                        rvcontinue: rvcontinue,

                        rvuser: 'JL-Bot',

                        titles: 'Wikipedia:WikiProject National Register of Historic Places/GA'

                    },

                    async:false

                })

                .responseText

            );

            for (var r in GA_Revs.query.pages"32766443"].revisions) {

                if (GA_Revs.query.pages"32766443"].revisionsr].timestamp,GA_Revs.query.pages"32766443"].revisionsr]["timestamp"!="2015-05-10T17:12:45Z") {

                    GA_UpdatesGA_Updates.length = GA_Revs.query.pages"32766443"].revisionsr].timestamp,GA_Revs.query.pages"32766443"].revisionsr]["*"]]

                }

            }

            if (GA_Revs"query-continue"]) {

                rvcontinue = GA_Revs"query-continue"].revisions.rvcontinue

            } else {

                break;

            }

        }

    }

    for (var i=0; i<FA_Updates.length; i++) {

        if (FA_Updatesi][0=="2014-06-28T18:12:43Z") {FA_Updates.splice(i,1); i--; continue}   // get rid of error/test updates

        var thisrevtext=FA_Updatesi][1

        var str="==={{Icon|FA}} Featured articles==="

        var FASectionBegin = thisrevtext.indexOf(str)

        thisrevtext=thisrevtext.substr(FASectionBegin,thisrevtext.indexOf("===",FASectionBegin+str.length)-FASectionBegin)

        FA_Updatesi][1=thisrevtext.match(/\[\[.*?\]\]/g).length



        var d=new Date(FA_Updatesi][0]);

        var timestampstr=d.getUTCFullYear().toString()

        var month=parseFloat(d.getUTCMonth()+1).toString()

        if (month.length<2) month="0"+month

        timestampstr+=month

        var day=d.getUTCDate().toString()

        if (day.length<2) day="0"+day

        timestampstr+=day

        FA_Updatesi][0=timestampstr

    }

    for (var i=0; i<GA_Updates.length; i++) {

        if (GA_Updatesi][0=="2014-06-28T18:12:26Z") {GA_Updates.splice(i,1); i--; continue}   // get rid of error/test updates

        var thisrevtext=GA_Updatesi][1

        GA_Updatesi][1=thisrevtext.match(/\[\[.*?\]\]/g).length



        var d=new Date(GA_Updatesi][0]);

        var timestampstr=d.getUTCFullYear().toString()

        var month=parseFloat(d.getUTCMonth()+1).toString()

        if (month.length<2) month="0"+month

        timestampstr+=month

        var day=d.getUTCDate().toString()

        if (day.length<2) day="0"+day

        timestampstr+=day

        GA_Updatesi][0=timestampstr

    }



    wikitext+='<textarea style="width: 100%; height: 300px" onclick="this.focus();this.select()" wrap="off">\n# 1 Date    2 FA_Count  3 Date      4 GA_Count  \n'

    for (var i=0; i<FA_Updates.length; i++) {

        wikitext+=FA_Updatesi][0+"    "+FA_Updatesi][1

        for (var k=0; k<12-FA_Updatesi][1].toString().length; k++) {wikitext+=" "}

        if (i<GA_Updates.length) wikitext+=GA_Updatesi][0+"    "+GA_Updatesi][1

        wikitext+="\n"

    }

    wikitext+='</textarea>\n\n'



    ProgressDiv.innerHTML+="Done! The results will now pop up in a new tab for copying."

    setTimeout(DumpData(wikitext), 5000);

}



function DumpData(wikitext) {

    var popup = open("");

    var div = popup.document.createElement("div");

    div.innerHTML=wikitext

    popup.document.body.appendChild(div);

}



$(ProgressPageHistoryButton)

Videos

Youtube | Vimeo | Bing

Websites

Google | Yahoo | Bing

Encyclopedia

Google | Yahoo | Bing

Facebook