alaingilbert / Turntable-API

Allows you to create bots for turntable.fm
http://alaingilbert.github.com/Turntable-API/
MIT License
318 stars 97 forks source link

Data returned on update_votes #208

Closed kgleason closed 11 years ago

kgleason commented 11 years ago

I've added in some logging into the python bot that I'm writing, and I got some unexpected data when looking at the update_votes event. When the vote is an Awesome, then the data returned is exactly what you have outlined in the sample data. However, if it is a Lame vote then the data looks identical except that the votelog section looks like this:

"votelog": [["", "down"]]

Normally I'd check the API docs from the main site but TT doesn't seem to have any public API documentation. I suspect that this might be by design.

Can anyone confirm that this is behaving as expected.

MikeWills commented 11 years ago

When a person awesomes, their avatar bops. The site needs the userid to know which avatar is bopping. When a person then lames (after an awesome), the avatar stops bopping. So the site again needs the userid to know to stop moving that avatar. If the person just lames, then the avatar doesn't do anything different. No userid is needed. So this is by design, but seems to not be consistent when we dive into this.

To summarize:

Lame only = no userid Awesome --> lame = userid

alaingilbert commented 11 years ago

The first time someone vote down, he is anonym... for privacy concern. So, you'll only know who's voting down if he has first voted up.

Long time ago, there was some individuals that were kicking out everyone who vote them down !

technobly commented 11 years ago

...goes back on vacation... :)

MikeWills commented 11 years ago

@alaingilbert I didn't know that. So my theory was right on it being a privacy thing? Cool

kgleason commented 11 years ago

It all makes perfect sense. Thanks for the quick responses. Sounds like there is nothing to change here.

alaingilbert commented 11 years ago

@MikeWills Yes ! @kgleason You're welcome :)

technobly commented 11 years ago

FYI: My experience has been trying to find those who are laming and call them out or make them known to the room just makes the whole room rage with madness. Haters gunna hate, just ignore them. I actually don't even post downvotes in my bot stats to keep people from noticing the lamers. Since a lame vote counts as 0, not -1.

MikeWills commented 11 years ago

You know what, that might be a good idea. Or better yet... just list how many voters there were, positive or negative.

kgleason commented 11 years ago

yeah I didn't intend to call out the lamers, or to react to it at all. I was mostly just looking to record as much data as I could for future stats tracking purposes. I am able to track the down votes by song, which gives me a good deal of data anyhow. I don't really need to know who is down voting. I want to be eventually be able to show which songs, artists, djs, etc have gotten the most X type of votes. I can get all of that.

technobly commented 11 years ago

@MikeWills I'd rather not count a lame as a vote at all, which would be confusing I think since it counts as 0. For stats tracking sites it's useful though.

gizmotronic commented 11 years ago

If you don't count a lame as a vote, you at least need to invalidate any awesome that user may have given. If you're tracking total votes, though, it's easier to just do the "votes += (awesomes - lames)" math when you see the endsong event, though. :)

technobly commented 11 years ago

Not exactly...

Every time on('update_votes', function (data) { }) fires, the vote log is updated with the total number of awexomes and lames.. there is no need to += anything. Same is true for endsong data, just grab the total awexomes and you're all set.

gizmotronic commented 11 years ago

Yeah, i realized that shortly after i mentioned it.

Where this is actually useful is if you're calculating the score on the fly, since even though the user's vote total can never go down, the downvotes do count for that purpose, regardless. My bot presents an accurate score at all times based on upvotes/downvotes.