AnotherDole / wrongest

The Wrongest Words
3 stars 0 forks source link

Lifetime card scores #21

Closed AnotherDole closed 9 years ago

AnotherDole commented 9 years ago

One of the things that storing game data in a Redis store would allow us to do is keep track of a card's score taking into account all games played with that deck. We could then see if certain cards are almost always winning or are never voted as most wrong.

One question would be whether to make this information publicly displayed somewhere. On the one hand, I think it would be fun to see the current champion on the deck or maybe the top 3. On the other hand, it might bias people's opinions and let them come up with arguments for the statement before playing with that deck. On the other other hand. you could view it as a challenge to successfully defend a statement that was previously indefensible.

AhoyLemon commented 9 years ago

I love the idea of tracking that data, and I think the value of it will probably show itself once we actually start collecting the data.

So I'm already planning on having wrongest.website be the URL for information about The Wrongest Words (letting wrongest.net stay as just the game itself), so maybe wrongest.website could have leaderboards and trends for decks?

I do see your point about not wanting to spoil the cards, and I think that's valid, but only for now. Hopefully eventually we'll have enough cards in the system that prereading a couple won't be too much of a spoiler.

Is it possible to get some sort of timestamp to this data? I guess I can't picture what it would look like, but I think that, if possible, it might be cool to have weekly trends rather than one big board that keeps counting up.

AnotherDole commented 9 years ago

I imagine what I could do is keep a lifetime count and a weekly count and write a script of some sort that runs every week to save the data from the weekly counts, add it to the lifetime counts, and then reset the weekly counts. The saved data could then be fed into a template to put on information site.

AhoyLemon commented 9 years ago

wish list is a great tag.

AnotherDole commented 9 years ago

Data is now tracked on a lifetime and week to week basis. It currently tracks the number of games started and finished per deck and the overall score of each card in each deck.

AhoyLemon commented 9 years ago

Is there currently a way to pull this data? Eventually I want to make a little webscript for it, but I'd also really like to tweet "The Wrongest Statement of the Week".

AnotherDole commented 9 years ago

I have direct access to it but there's no public interface for it. How do you want to access it and in what format?

AnotherDole commented 9 years ago

I should also say that right now it only tracks votes from completed games.

AhoyLemon commented 9 years ago

I think the easiest scenario would be a javascript object. If there was some URL that spit back a JSON object, then whatever page could parse that out.

AnotherDole commented 9 years ago

Okay, just pushed my first stab at this.

To get the lifetime scores of cards in a deck, send a GET to /scores/{deck name}/lifetime

To get the weekly scores, send a GET to /scores/{deck name}/{first day of week}/{last day of week} where the days are in the format of MMDDYY. So to get next week's data, you would GET /scores/Best of The Wrongest Words/040515/041115

Both return a JSON object where the properties are the quotes and the values are the scores. If there's no data there it will just be { }

The quotes will still include the braces for the hidden part.

AhoyLemon commented 9 years ago

Hmmmm, I don't think I get it...

Test Pen

AnotherDole commented 9 years ago

It has to be $.getJSON( "http://www.wrongest.net/scores/Best of The Wrongest Words/lifetime", function( data ) {

You'll just get { } back now though because no one has finished a game since I put that code it yet.

AhoyLemon commented 9 years ago

Fuck yeah, it works!

AhoyLemon commented 9 years ago

Early test here.

AhoyLemon commented 9 years ago

Note to self: In order to get the Twitter deck, use...

Twitter%20%23bullshit
AnotherDole commented 9 years ago

Okay this will be all different once I update the server.

/top10/lifetime will give you something like ["{The cuteness of} someone decreases quickly if they are liberal, democrat or a feminist.","0","{The first couple Matchbox 20} albums are actually really good.","0","{The iPhone} was the key piece of technology that allowed humans to finally travel to the moon.","0","{The smarter you are,} the more skeptical you are about climate change.","0","{There genuinely are} monsters under children's beds.","0","{There is no such thing as a \"best\"} when it comes to sports or sports teams.","0","{Warhammer 40,000} can make anything awesome.","0","{Zombies} caused the end of the Roman Empire.","0","All fluffy {Mexicans} have delicious thigh.","2","{Us white people} suffer the most racism in America.","2"]

i.e. an array where result[i] is the quote and result[i+1] is its score. Scores are strings so you'll need to parseInt them.

/bottom10/lifetime will give something similar except for the lowest scores. /bottom10/040515/041115 will give the same thing except only taking into account games played this week.

AhoyLemon commented 9 years ago

:+1: