During the last few Mafia games I’ve played, I found myself wanting to be able to quickly filter the posts on the current page for various reasons. Today, I decided to package a few of these filters into a Chrome extension (sorry FF/Greasemonkey users, no love for you [yet?]).
Version 1.0 is available here and contains the following filters:
[ul]
[li]By Username[/li][li]Online Players[/li]liVoters[/li][/ul]
I’m looking for ideas for more filters or other functionality to add, so please give it a tumble and let me know what you think.
Note: if you wish to inspect the code before installing the extension, download the file from the link above, change the file extension to .zip and then view the contents with your favourite archive program.
So, I already have some ideas for stuff to add to the next version:
the ability to give each player in a game a town/scum rating; I’m thinking a scale of +5 through -5 with 0 being the default (neutral) and the extremes being for confirmed/dead players
filters to only show posts from players with certain ratings/ranges
right now the toolbar is shown on any SDMB thread; it’s fairly unobtrusive, but I think I can find a way to only have a small icon appear in the address bar on threads with ‘mafia’ in the title; clicking the icon would then display the toolbar and add that thread to a list of threads to automatically display the toolbar when reading (a close button would be added to the toolbar which would remove a thread from this list)
I’d also like to add a toolbar button that will retrieve all posts from all pages in the thread via an ajax call and display them in the current page; this would make the filters a lot more useful, I think, being able to filter the entire game instead of just a single page, which even when set to 200 posts per page is usually not an entire Day
also considering changing the filter setup from being single filter buttons to a set of checkboxes to allow the use of multiple filters; this is lower priority unless I get the page consolidation function working and add more filters first
How does your script recognize voters/unvoters? Does it assume a color scheme, or does it look for the word “vote” (or “unvote”) followed by a username? Does it correctly deal with quoted votes?
The vote filter looks for any coloured text, excluding green, containing the word “vote”; assuming quoters bleach the votes like they’re supposed to, this should suffice. I’ll look into automatically excluding quoted votes, it should be doable, I think.
The link in the OP has now been updated to version 2.0 which is just a fancy way of saying that the manifest.json file has been updated to the new format required by Chrome.
It seems the little icon I included in the toolbar has been broken by the update, I’ll get around to fixing that soon™.
Just to re-cap, these are the functions that this extension provides for in it’s current state:
Page consolidation: at a button click, all pages of the current thread will be consolidated and loaded into the browser; on really long game threads this can take a few seconds, but I find that it makes the filters below more useful
Filters: at a button click, or via drop-down, the posts on the page can be filtered to show only a specific player or all posts containing un-bleached votes
Edit: a known bug - after page consolidation, multi-quote toggling is broken (and possibly some other cookie-related features)
Hm, that could be really useful. Now all we need is a fuzzy-matching routine to correct misspelled or nicknamed usernames and count up the totals.
Actually, one other more realistic request: Would it be possible to add a filter for end-of-Day/Night posts? Or at least, posts by the moderator of the game? It’s useful when looking at vote posts to be able to see at a glance which Day they were made on.