I happened across this thread this morning, and didn’t realize it was a zombie until I noticed a banned user posting in it. Something about ‘BANNED’ appearing under the user’s name catches my attention a lot better than the date of post. I know I’m not the only one who gets a little frustrated reading a thread and noticing 30 posts in that it’s a zombie, so I put together a quick greasemonkey script to identify zombie threads for me:
// ==UserScript==
// @name Zombie ID
// @namespace http://www.straightdope.com
// @description ID Zombies
// @include http://boards.straightdope.com/sdmb/showthread.php?*
// ==/UserScript==
var zombieAgeInDays = 120;
var monthIndex = 0;
var dayIndex = 1;
var yearIndex = 2;
var zombieText = "*** ZOMBIE ***"
var allT = document.evaluate('/html/body/div[2]/div/div/div/div/table/tbody/tr[1]/td/div[2]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < allT.snapshotLength; i++) {
var dateField = allT.snapshotItem(i).textContent;
if (dateField.indexOf('Yesterday') == -1 && dateField.indexOf('Today') == -1) {
date_parts = dateField.replace(/^\s+|\s+$/g,"").split(',')[0].split('-');
d = new Date(parseInt(date_parts[yearIndex]), parseInt(date_parts[monthIndex]) - 1, parseInt(date_parts[dayIndex]));
tday = new Date();
if (tday.valueOf() - d.valueOf() > zombieAgeInDays * 24 * 3600 * 1000) {
allT.snapshotItem(i).textContent = allT.snapshotItem(i).textContent + zombieText;
}
}
}
How does it work? First, you have to have the greasemonkey plug-in installed for firefox (may work with other browsers - I have very little experience in this area.) Set this us as a script to run on all urls that match “http://boards.straightdope.com/sdmb/showthread.php?", and when you’re reading the thread itself, it parses all the dates for each of the posts, and if they’re greater than 120 days ago, it adds "** ZOMBIE ***” to the post’s header. This catches my eye quite noticeably.
You can make some changes fairly easily, even if programming’s not your thing. If 120 days isn’t the right cutoff for a zombie for you, edit the line that says:
var zombieAgeInDays = 120;
to be whatever age is appropriate. If you’re viewing your dates in a non-American way (it’s currently set up to assume the date is displayed as mm-dd-yyyy), you can change the order of these variables:
var monthIndex = 0;
var dayIndex = 1;
var yearIndex = 2;
(I haven’t tested this, because I can’t actually find the vbulletin setting to control date display. This does exist, doesn’t it?)
This is about the second greasemonkey script I’ve written, so if any of you more experienced have any suggestions for improvement feel free to let me know, or just make them and add to this thread. Also feel free to let me know if you see any problems.
Enjoy.