Browser Extension Vote-Counter (early demo)
-
-
JacksonVirgo they/himSurvivorthey/him
- Survivor
- Survivor
- Posts: 13492
- Joined: October 29, 2019
- Pronoun: they/him
- Location: ɐılɐɹʇsn∀
I wanted to work on something that didn't need you to add aliases for abbreviations or other things like this, and I want it reliable so I wanted to make sure to really put effort into fine-tuning, of which I don't really have time for rn-
-
Psyche he/theySurvivorhe/they
- Survivor
- Survivor
- Posts: 10901
- Joined: April 28, 2011
- Pronoun: he/they
ok great!
i think i want to contribute along those lines if you're open, as i've done a lot of the legwork already in my various abandoned projects.
i'm willing to make sure it's in the right language and style too.
i think all i'd need to set things up is the initial implementation for the part of the code that parses votes
id implement a measure of parsing performance based on ability to predict lim outcomes across past games, setting up an efficient way to consider alternative parsersYou can't step in the same river twice.-
-
JacksonVirgo they/himSurvivorthey/him
- Survivor
- Survivor
- Posts: 13492
- Joined: October 29, 2019
- Pronoun: they/him
- Location: ɐılɐɹʇsn∀
Of course :DIn post 26, Psyche wrote: ok great!
i think i want to contribute along those lines if you're open, as i've done a lot of the legwork already in my various abandoned projects.
i'm willing to make sure it's in the right language and style too.
i think all i'd need to set things up is the initial implementation for the part of the code that parses votes
It's better to not reinvent the wheel after all
To be super clear I'm working in Typescript and the place I'm using the library is "/src/app/votecount.ts" line 123.
If you have any questions let me know.-
-
JacksonVirgo they/himSurvivorthey/him
- Survivor
- Survivor
- Posts: 13492
- Joined: October 29, 2019
- Pronoun: they/him
- Location: ɐılɐɹʇsn∀
It's literally just a library I'm calling though so if you want the implementation they used, here is the JS file-
-
Psyche he/theySurvivorhe/they
- Survivor
- Survivor
- Posts: 10901
- Joined: April 28, 2011
- Pronoun: he/they
thanks. will be somewhat slow-going bc of what i'll have to learn but i'm legit happy for the excuseYou can't step in the same river twice.-
-
RH9 he/himMafia Scumhe/him
- Mafia Scum
- Mafia Scum
- Posts: 2910
- Joined: November 15, 2019
- Pronoun: he/him
- Location: Epping, New South Wales, Australia
I might try this out the next time I mod something.In post 16, JacksonVirgo wrote:Update v0.0.3 Changelog:Download Link- The wagon formatting will now have the larger wagons at the top.
- No-Elimination now is implemented with unique majority mech. 50% of living players is needed rather than a flat majority.
- I've implemented new game definition settings, allowing to disable specific functionality. Currently only can disable no-elim but can easily be extended or copied into a way to add special/unique functionality that isn't usually used.
- Now has manifest v2 support (so now you can run it in Firefox, although the styling in firefox is kinda wacky cuz I haven't focused on designing for it yet)
Spoiler: Technical Changelog-
-
JacksonVirgo they/himSurvivorthey/him
- Survivor
- Survivor
- Posts: 13492
- Joined: October 29, 2019
- Pronoun: they/him
- Location: ɐılɐɹʇsn∀
I'm not sure how reliably this thread is getting checked, if nobody that can answer this answers it I'll ask the right people directly but is it permitted/okay to add a form of analytics to the tool, it would be to focus on being able to identify and fix bugs, and also to know what feature gets used the most etc (to see what should be focused on).
The stuff logged would be- The thread the VC was requested for
- The VC settings that was requested
- The user who used the tool
- Time when the tool was used and the time it took to process everything
The VC settings/thread is to be able to replicate the issue when errors pop up.
The time and user is just nice information to have but not super important-
-
JacksonVirgo they/himSurvivorthey/him
- Survivor
- Survivor
- Posts: 13492
- Joined: October 29, 2019
- Pronoun: they/him
- Location: ɐılɐɹʇsn∀
Anything is better than nothing, I'm happy to answer whatever question or help in whatever way I can. I'd love any help I can get :DIn post 29, Psyche wrote: thanks. will be somewhat slow-going bc of what i'll have to learn but i'm legit happy for the excuse-
-
JacksonVirgo they/himSurvivorthey/him
- Survivor
- Survivor
- Posts: 13492
- Joined: October 29, 2019
- Pronoun: they/him
- Location: ɐılɐɹʇsn∀
I'll give you the general rundown of the current workflow I'm using.
The "/src" directory is the root folder as per usual.
The "/src/app" is for content scripts, the scripts that will be run on the site itself.
The "/src/background" is for background scripts. So the code that does a lot of the heavy work like data fetching.
The "/src/types" contains global types and validators. I use Zod, which is not too difficult to understand but I might reword the variables to make it extra clear for you.
The "/src/utils" contains globally used utilities as per the name.
The main.css is what gets injected into the site itself. Might be worth renaming to "injected.css" or something.
I use JQuery (really hurts me) to edit the sites DOM and I use Cheerio (which is like a backend JQuery) to fetch the data so the logic is all the same pretty much.
Using JQuery to create large UI elements is actually cursed but I don't really know how to fix this outside of possibly using iframes but I think they're deprecated? Not sure-
-
JacksonVirgo they/himSurvivorthey/him
- Survivor
- Survivor
- Posts: 13492
- Joined: October 29, 2019
- Pronoun: they/him
- Location: ɐılɐɹʇsn∀
Turns out, iframes are not deprecated and might be worth looking into. Not sure-
-
Ircher He / Him / HisWhat A Grand IdeaHe / Him / His
- What A Grand Idea
- What A Grand Idea
- Posts: 15207
- Joined: November 9, 2015
- Pronoun: He / Him / His
- Location: CST/CDT
Can we make a version that works on mobile?-
-
JacksonVirgo they/himSurvivorthey/him
- Survivor
- Survivor
- Posts: 13492
- Joined: October 29, 2019
- Pronoun: they/him
- Location: ɐılɐɹʇsn∀
I'm not actually sure, but I'll look into it for sure-
-
Thestatusquo He/HimSheaHe/Him
- Shea
- Shea
- Posts: 14381
- Joined: July 27, 2006
- Pronoun: He/Him
- Location: Chicago!
Jquery is definitely the best way.
What are you having difficulty with?tout comprendre c'est tout pardonner-
-
JacksonVirgo they/himSurvivorthey/him
- Survivor
- Survivor
- Posts: 13492
- Joined: October 29, 2019
- Pronoun: they/him
- Location: ɐılɐɹʇsn∀
It's not difficult as much as it's incredibly funky to create more complex UI elements using it.In post 37, Thestatusquo wrote: Jquery is definitely the best way.
What are you having difficulty with?-
-
Thestatusquo He/HimSheaHe/Him
- Shea
- Shea
- Posts: 14381
- Joined: July 27, 2006
- Pronoun: He/Him
- Location: Chicago!
Can't you just create a template file and then pass it in as a parameter?tout comprendre c'est tout pardonner-
-
JacksonVirgo they/himSurvivorthey/him
- Survivor
- Survivor
- Posts: 13492
- Joined: October 29, 2019
- Pronoun: they/him
- Location: ɐılɐɹʇsn∀
I didn't know that was an optionIn post 39, Thestatusquo wrote: Can't you just create a template file and then pass it in as a parameter?-
-
JacksonVirgo they/himSurvivorthey/him
- Survivor
- Survivor
- Posts: 13492
- Joined: October 29, 2019
- Pronoun: they/him
- Location: ɐılɐɹʇsn∀
Oh, no I did know that was an option. I just didn't think of that-
-
JacksonVirgo they/himSurvivorthey/him
- Survivor
- Survivor
- Posts: 13492
- Joined: October 29, 2019
- Pronoun: they/him
- Location: ɐılɐɹʇsn∀
Yo it works so nicely, thanks for that. What a legend-
-
Thestatusquo He/HimSheaHe/Him
- Shea
- Shea
- Posts: 14381
- Joined: July 27, 2006
- Pronoun: He/Him
- Location: Chicago!
Welcome to my job lmao.tout comprendre c'est tout pardonner-
-
JacksonVirgo they/himSurvivorthey/him
- Survivor
- Survivor
- Posts: 13492
- Joined: October 29, 2019
- Pronoun: they/him
- Location: ɐılɐɹʇsn∀
This is generally the form design I'm going with. I've still only got the upload input and the two post inputs but I'll flesh it out so that everything needed is there.
Uploading the yaml file is planned to auto-fill the form with all the appropriate data.
It's also an idea to store the data for each thread onto disk so that if you do fill out the form once, on new pages it should be filled by default. Maybe an option to export the form to yaml is an idea.
I want to add member verification to the tool too. So I can verify if a user actually exists with a given name or if you made a typo or something etc. Are usernames case-insensitive when it comes to making it unique? Can a JacksonVirgo and a jacksonvirgo both exist as two accounts?
Either way, the verification method I found is using the member list such as the following link and I can do a quick scrape to verify it but maybe that's a little intense to have for the server? Cuz that's like X fetches for X users and then the game fetching itself. Unsure
memberlist.php?username=JacksonVirgo-
-
JacksonVirgo they/himSurvivorthey/him
- Survivor
- Survivor
- Posts: 13492
- Joined: October 29, 2019
- Pronoun: they/him
- Location: ɐılɐɹʇsn∀
I am curious what you've got, I recall you saying that you do some funky stuff regarding this (from osuka's thread I believe). If you have time I'd love to see how you did itIn post 26, Psyche wrote: i think i want to contribute along those lines if you're open, as i've done a lot of the legwork already in my various abandoned projects.-
-
Psyche he/theySurvivorhe/they
- Survivor
- Survivor
- Posts: 10901
- Joined: April 28, 2011
- Pronoun: he/they
The broad idea behind the validation framework is to bootstrap evaluation of votecounters using info recorded in the site's various game archives.
The game archives tracks for a lot of games who was eliminated each day, and eliminations (usually) depend on votes.
Therefore a good votecounter, given each thread mentioned in the archive and a post number initiating each day, should be able to reliably predict who was eliminated those days.
Not necessarily all of them -- mods can make weird calls or flat-out mistakes, PRs and other shenanigans can mess with hammer conditions, and aliases (like alt or irl names) might have nothing to do with a slot's username.
But still, most of them.
So what I did was take archive data, scrape applicable games, and set my votecounter to predict D1 outcomes across all of them.
Wherever there were errors, I checked them out. I ignored errors that could not be addressed with a fix to my votecounter, and tabulated -- and eventually fixed -- errors that potentially could.
Once errors were addressed enough for D1 outcomes, I similarly generated predictions for successive days.
Frequently, I needed to manually annotate D2+ post number start positions when long twilights messed with votecounting, but this also helped identify cases where the votecounter accurately predicted a lim, but thought hammer happened earlier or later than it really did.
So this method wasn't a perfect way of testing and identifying gaps in the votecounter, but it saved a lot of time compared to the hypothetical alternative of manually coding the target of every vote across games on the site and using those as test cases. And remains usable for new votecounter implementations that might be introduced in the future.
The votecounter was a grab-bag of different techniques. The validation technique confirms it works well, but because of the feedback-driven process behind how I made it, it doesn't have some basic principle behind it.You can't step in the same river twice.-
-
DragonEater70 He/HimJack of All TradesHe/Him
- Jack of All Trades
- Jack of All Trades
- Posts: 8128
- Joined: February 4, 2023
- Pronoun: He/Him
- Location: UTC+2
Can you please explain how to install on Firefox?
It says the add-on is corrupt when I try to "install add-on from file" and install "manifest.json"-
-
Thestatusquo He/HimSheaHe/Him
- Shea
- Shea
- Posts: 14381
- Joined: July 27, 2006
- Pronoun: He/Him
- Location: Chicago!
You need to use manifest v2 for ff I believe.tout comprendre c'est tout pardonner-
-
JacksonVirgo they/himSurvivorthey/him
- Survivor
- Survivor
- Posts: 13492
- Joined: October 29, 2019
- Pronoun: they/him
- Location: ɐılɐɹʇsn∀
I've found that Firefox is a little weird when it comes to loading unpacked extensions and you need to load it in a different area than traditional extensions for some reason, probably security. You can do so via the followingIn post 47, DragonEater70 wrote: Can you please explain how to install on Firefox?
It says the add-on is corrupt when I try to "install add-on from file" and install "manifest.json"
These will need to be re-installed every time you restart your browser, which is not ideal so I don't recommend outside of testing.
I am going to be working on getting the extension validated by Firefox itself so you can install it properly and without it being temporary, but I haven't looked too far into it so I have no idea if I can or not but:- Download the latest version here.
- Extract the .zip file, there should be two folders within called v2 and v3. If not, you downloaded the wrong version.
- Open Firefox and in the URL bar enter "about:debugging"
- Press the "This Firefox" option on the left-hand side of the screen
- Make sure the "Temporary Extensions" drop-down is opened and click the "Load Temporary Add-ons..." button.
- You will be prompted with a file explorer, find the manifest.json in the v2 folder and upload that.
- You may be prompted with something asking for permissions to access that folder (or maybe folders that it is under, such as Downloads etc)
Copyright © MafiaScum. All rights reserved.