Farktography.net :: View topic - Displaying places in the voting results page
Farktography.net

Software - Displaying places in the voting results page

CauseISaidSo - 12.08.2010 18:53
Post subject: Displaying places in the voting results page
I love schnee's statistics (it's part of what makes farktography fun, IMHO), but I wish the rankings refreshed a little more frequently.

Maybe I'm the only one, but I check the voting results page often to see how things are going. Since I'm not U-Man or soosh Smile, I have to count down many (often times many many) entries to see where my pix have placed and how badly my average standings evar stat will be affected.

I considered creating my own stats site, but I just don't have the time to do that right now, so I went with the next best thing - I whipped up some java script to add places to the existing voting results page. Each entry will look something like this:



I've tested this in both IE and Chrome (no Firefox or Safari, but it should work there, too; at worst, it can't do any harm). To add places to the voting results page:

1) Open the voting results page (you do have it bookmarked, right?)

2) Paste the javascript below (the entire script should be one single line) into the address bar of your browser and press enter.

That's it! It should work for any week's contest. Here's the script:

javascript:var%20n=0,p=0,lv=0,x=$('td.commentHeaderRow[colSpan="3"]%20font').each(function(){n=n+1;var%20a=$(this).text();a=a.substr(0,a.indexOf("%20"));if(a!=lv){p=n;lv=a}var%20b="th",d=p%25100;if(d<4||d>20){var%20c=p%2510;if(c==1)b="st";else%20if(c==2)b="nd";else%20if(c==3)b="rd"}$(this).before('<span%20style="float:right;margin-right:8px"><font%20size="+1">'+p+b+"%20Place%20(Entry%20#"+n+")</font></span>")})

Edited on 2012-Feb-4 to add:
The script above has been updated to match recent Fark HTML changes. Also note that it works on either Best or Funny vote results pages (and also on Photoshop contests).

Important note for IE9 users: For some reason, IE9 eats the leading "javascript:" when you first paste it into the broswer address bar. Just go back to front of the address bar and type it back in before pressing Enter and it'll work.
sleeping - 12.08.2010 20:25
Post subject: RE: Displaying places in the voting results page
Nice! And if you paste the code into a bookmark instead of the address bar it's re-usable.
ravnostic - 12.08.2010 20:52
Post subject: RE: Displaying places in the voting results page
Hrmm...why didn't my comment stick? I think this is way cool. I've faired really well these past couple of weeks, but since that isn't usually the case, this is useful stuff! Thanks for the innovation!
U-Man - 12.08.2010 22:11
Post subject: RE: Displaying places in the voting results page
Yep. Works with Firefox, too. Very cool. And thank you for the compliment.

I like this sort of mix of creativity and technical ability. Good stuff.
nobigdeal - 12.08.2010 22:14
Post subject: RE: Displaying places in the voting results page
Cool!
Kestrana - 12.08.2010 22:47
Post subject: RE: Displaying places in the voting results page
Nvm I got it to work
olavf - 12.08.2010 22:56
Post subject: RE: Displaying places in the voting results page
Very cool. And depressing at the same time...

Wink
CauseISaidSo - 12.08.2010 23:42
Post subject: Re: RE: Displaying places in the voting results page
      olavf wrote:
Very cool. And depressing at the same time...


Thanks. And I hear ya.

I think I picked the wrong contest to implement this. Fare thee well, oh Greatest Averages Evar list, I hardly knew ye. Sad
olavf - 13.08.2010 00:16
Post subject: Re: RE: Displaying places in the voting results page
      CauseISaidSo wrote:
      olavf wrote:
Very cool. And depressing at the same time...


Thanks. And I hear ya.

I think I picked the wrong contest to implement this. Fare thee well, oh Greatest Averages Evar list, I hardly knew ye. Sad


You're pretty new, so it comes and goes. A lot. Give it time Wink
LeicaLens - 13.08.2010 00:47
Post subject:
Very useful!

And slightly depressing at the same time.
lokisbong - 13.08.2010 03:14
Post subject: Re: RE: Displaying places in the voting results page
      olavf wrote:
Very cool. And depressing at the same time...

Wink


thats what I was just gonna post.
orionid - 13.08.2010 13:23
Post subject: Re: RE: Displaying places in the voting results page
      sleeping wrote:
Nice! And if you paste the code into a bookmark instead of the address bar it's re-usable.

Huzzah!

Awesome code, <b>'cause</b>. Now, if you write a neat little script to add the bookmark button to the top of the browser, you could market it as a chrome/ie plugin to all the PSers! Wink
kashari - 29.09.2010 18:47
Post subject:
Maybe this would be a good place to ask this question: Why do the final stats skip places? i.e., it will go 1, 2, 4, 5 7, etc.. Awhile ago I looked around and didn't find an answer, but I may have missed it.

And thanks for this tip, I'll give it a shot!
orionid - 29.09.2010 19:28
Post subject:
If there is a tie, it will assign everyone with that number of votes the highest place, then resume at the next available place. So, in your above example, there would be a two-way tie for second place (eating up the #3), and a two way tie for fifth (eating up the #6).
Kestrana - 29.09.2010 19:29
Post subject:
If there's a tie, the next rank will be skipped so that the total number of photographs for any given sequence is the same.

So if two people tie for 2nd place, 3rd place will be skipped and the next highest picture will be 4th.
kashari - 29.09.2010 22:25
Post subject:
Ahhh, ok, thanks Kestrana & Orionid!

Now that I think about this some more, why does it work that way? Why isn't there a tie for each place without skipping the subsequent places? Or is that just the way the FSM works?
Curious - 02.10.2010 01:16
Post subject:
thanks for the script CauseISaidSo. did as was suggested and made it a bookmark and have used it for this weeks contest and some photoshop contests. works fine.
Curious - 02.10.2010 01:21
Post subject:
      kashari wrote:
Ahhh, ok, thanks Kestrana & Orionid!

Now that I think about this some more, why does it work that way? Why isn't there a tie for each place without skipping the subsequent places? Or is that just the way the FSM works?


there is a tie, that what caused the skip. there was a raging debate recently in the PSAEF about the best way to list ties and this method won out. more by default but it does have it's fans. me included.
kashari - 02.10.2010 13:04
Post subject:
      Curious wrote:
      kashari wrote:
Ahhh, ok, thanks Kestrana & Orionid!

Now that I think about this some more, why does it work that way? Why isn't there a tie for each place without skipping the subsequent places? Or is that just the way the FSM works?


there is a tie, that what caused the skip. there was a raging debate recently in the PSAEF about the best way to list ties and this method won out. more by default but it does have it's fans. me included.


What is the PSAEF? Maybe I should read that and see if it helps clarify it because I still don't get why a place gets skipped and I don't want to jack this thread. Thanks!
lokisbong - 02.10.2010 13:21
Post subject:
Photoshop audio edit forum on fark.
Curious - 02.10.2010 13:23
Post subject:
      kashari wrote:
What is the PSAEF? Maybe I should read that and see if it helps clarify it because I still don't get why a place gets skipped and I don't want to jack this thread. Thanks!


it's the PhotoShop and Audio Edit Form forum on fark where all the cool (or is it kewl?) kids hang out.
http://www.fark.com/cgi/comments.pl?IDLink=6 [1]
mainly devoted to photoshop questions (audio edit contest being lacking these days) and also where the farktographers are prone to go since we don't have an official forum on fark. it was this lack of our own forum on fark that lead to farktography.net being established. plus with this site we can have many threads rather than a disjointed thread with many subjects.

now when i say the PSAEF is mainly devoted to photoshop questions that is a bit of a misnomer. recently we have been talking about a members new tortoise. it's actually a rambling open forum that is supposed to just be for photoshop and if the discussion gets to far afield Gwenny will cut you. yea for inside jokes Smile

the question of ties and how to report them came up because one of the folks there was writing a new stats generator and wondering how to place tie votes. ie 1,2,2,2,3 or 1,2,2,2,5. the latter is what you are questioning.

as far as jacking this thread IMO placement/ties is part and parcel of the conversation.
Curious - 02.10.2010 13:27
Post subject:
      lokisbong wrote:
Photoshop audio edit forum on fark.


well you can be succinct but i prefer verbose in my answers Smile
lokisbong - 02.10.2010 13:47
Post subject:
      Curious wrote:
      lokisbong wrote:
Photoshop audio edit forum on fark.


well you can be succinct but i prefer verbose in my answers Smile
I not good with words. Make sentence short. lol Laughing
That and I don't frequent that side of fark very much. I probably should more often.
kashari - 02.10.2010 15:53
Post subject:
Laughing Thanks Curious and Lokisbong!

Phew, I'm grateful for Farktography.net rather than having everything in one thread like that. (but the tortoise is cute!) I kind of browsed the last few pages of the thread and couldn't find the discussion, so as long as it's ok to stay here with it, I will.

I don't understand why skipping places would be preferred? Why not have a 3-way tie for second and then your fifth place becomes third?
orionid - 02.10.2010 18:46
Post subject:
Because that person is still behind four other people, thus fifth overall.
nobigdeal - 02.10.2010 19:02
Post subject:
      kashari wrote:
Laughing Thanks Curious and Lokisbong!

Phew, I'm grateful for Farktography.net rather than having everything in one thread like that. (but the tortoise is cute!) I kind of browsed the last few pages of the thread and couldn't find the discussion, so as long as it's ok to stay here with it, I will.

I don't understand why skipping places would be preferred? Why not have a 3-way tie for second and then your fifth place becomes third?


I agree. If you have the 5th most votes you should be in 5th place.
Curious - 02.10.2010 19:54
Post subject:
      orionid wrote:
Because that person is still behind four other people, thus fifth overall.


      NoBigDeal wrote:
I agree. If you have the 5th most votes you should be in 5th place.



more succinct answers Smile
bucky_bacon - 02.10.2010 21:31
Post subject:
Brevity ftw.
olavf - 02.10.2010 23:18
Post subject:
      bucky_bacon wrote:
Brevity ftw.


That's *NOT* what she said.
kashari - 03.10.2010 01:07
Post subject:
      orionid wrote:
Because that person is still behind four other people, thus fifth overall.


But they still had the same number of votes, so that should take one place. Otherwise, it's like two of the second place people then really come in third and fourth, instead of being tied for second. You can't get to five without having 3 & 4, that's illogical! Very Happy

It's like you freaks that change your clocks twice a year, the sun is still in the same place, no matter what mechanical games you play! Razz
ravnostic - 03.10.2010 06:47
Post subject:
      kashari wrote:


It's like you freaks that change your clocks twice a year, the sun is still in the same place, no matter what mechanical games you play! Razz


We Arizonan's don't follow that insanity. Just sayin'. We get plenty of daylight and don't need to economize. Razz

On the vote placement front, changing things would be a disaster of biblical proportions--old testament--real wrath of God stuff--40 years of darkness, the dead rising, cats and dogs, living together...
CauseISaidSo - 04.03.2016 13:13
Post subject:
For the maybe one other person besides me who still visits the forums and uses this (looking your way, orionid), here's the modified javascript that works with the latest voting results page:

      Code:
javascript:(function()%7Bvar%20a%3D0%2Cb%3D0%2Cc%3D0%3B%24('td.commentHeaderRow%5BcolSpan%3D%224%22]%20span').each(function()%7Ba%3Da%2B1%3Bvar%20d%3D%24(this).text()%3Bd%3Dd.substr(0%2Cd.indexOf(%22%20%22))%3Bif(d!%3Dc)%7Bb%3Da%3Bc%3Dd%7Dvar%20e%3D%22th%22%2Cg%3Db%25100%3Bif(g%3C4%7C%7Cg%3E20)%7Bvar%20f%3Db%2510%3Bif(f%3D%3D1)e%3D%22st%22%3Belse%20if(f%3D%3D2)e%3D%22nd%22%3Belse%20if(f%3D%3D3)e%3D%22rd%22%7D%24(this).before('%3Cspan%20style%3D%22float%3Aright%3Bmargin-right%3A8px%3Bfont-size%3Alarger%22%3E'%2Bb%2Be%2B%22%20Place%20(Entry%20%23%22%2Ba%2B%22)%3C%2Fspan%3E%22)%7D)%7D)()

All times are
Links
  1. http://www.fark.com/cgi/comments.pl?IDLink=6