Wikipedia:WikiProject User scripts/Scripts/Show recent comments

This will eventually allow people to hide discussions on talk pages (or the VP) that occurred before a given date. It is in semi-complete form below.

This will eventually allow people to hide discussions on talk pages (or the VP) that occurred before a given date. It is in semi-complete form below.

  • It needs:
    • An interface to set the uptodate.
    • A way to identify sections, rather than just paragraphs, so whole sections that have been updated can be shown, rather than just the paragraphs that have been updated.
    • A option to show, rather than hide, childNodes that have no dates in them.
    • Bells, whistles and gongs, of course!

Please improve, modify, suggest, critique, etc. Thanks! JesseW 09:09, 31 August 2005 (UTC)


uptodate=new Date("Aug 26 2005"); //This is the date which things need to be after to show up.
tokeep=new Array(); //The array that stores the info about which pieces to keep.
bc=document.getElementById("bodyContent"); //Shorthand
z=bc.childNodes; //Shorthand
for (x=0;x<z.length;x++) { //Go through each childNode of bodyContent
  tokeep[x]=z[x]; //Put the node into tokeep (if kept, this will be later be replaced by true.)
  if (z[x].textContent) { //Some things don't have textContent
    //This matches the signature date format. (Odd other formats are not yet handled.)
    q=z[x].textContent.match(/[0-9]+:[0-9]+, [0-9]+ [A-Z][a-z]+ [0-9]+ [(]UTC[)]/);
   if (q) { //Some things don't have any dates in them
      //This turns it into a Date object(it needs to be reformatted for the sake of the parser)
      q=new Date(String(q).replace(/(.+), (.+) [(]UTC[)]/, "$2 $1 GMT"));
     if (q>uptodate) { //Is it after uptodate?
        tokeep[x]=true  //Then keep it.
      }}}};
for (x=0;x<tokeep.length;x++) { //Go through tokeep and do the removals.
  if (tokeep[x]!=true) {
   bc.removeChild(tokeep[x])
 }}


Colorized with http://blogs.applibase.net/prasad/downloads/jscolorizer/jscolorizer.html, pre tags removed, spaces added at the beginning of every line.

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.