From: "Mauricio Fernández" Date: 2002-08-15T20:39:44+09:00 Subject: Re: Ruby Weekly News On Thu, Aug 15, 2002 at 04:55:45PM +0900, Holden Glova wrote: > I wonder how voting would work - would people actually be bothered to use it? > Interesting idea Mauricio. I think I have a better one: include the vote in the message itself! It would work that way: you register yourself somehow (web form, email, whatever), and you can get up to N vote ids per week. It's up to you to decide how to spend them in the messages you post. If you find an interesting thread AND have something to say about it, you include the vote id number in your message. Note you're voting the thread, not your message :-) This way two interesting things will happen: * longer threads are more likely to receive a high number of votes * however, long "how do I?" questions not that interesting will not get automatically selected. It's still us who decide what is worth including in the RWN, not a "stupid rule" :) As for the implementation: I hope we can assume nobody will try to crack this, so we don't really have to implement tight security measures. It could go as follows: to register, send a message to some mailbot, in which you basically claim your email address is . The request is rejected if you have never participated in the mailing list. Otherwise, a login/password pair is sent to the address you claimed. If you reply, the system will register you as a valid user. Then, either setup a web page somewhere where given the id and pw a registered user can get its N voting tokens for this week/month/whatever or send it by email. Counting: the script is run automatically every week. It knows the valid vote ids for that week (more on this below) and only accepts these. A selection of the most voted threads is posted to the guy in charge of RWN. As for the votes: something like ##nickname:md5_hash## included in the message. Generating the IDs: require "md5" code_string = "ruby rules!" # this is only known by the maintainer # of the script username = gets username.chop! t = Time.now interval = 7 ## issue new vote ids each interval days basestr = "#{code_string}-#{t.month}/#{(t.day/interval).floor}/#{t.year}" + "-#{username}" puts "Today is " + t.to_s puts "Using base string: #{basestr}" numtokens = 3 # num of allowed votes per interval (1..numtokens).each do |i| str = basestr + sprintf("%2d", i) theid = "###{username}:#{MD5.hexdigest str}##" puts "Generated token: #{theid}" end Output: batsman Today is Thu Aug 15 13:30:06 CEST 2002 Using base string: ruby rules!-8/2/2002-batsman Generated token: ##batsman:3d473f1bc6038310932db2014ea3a06c## Generated token: ##batsman:4a39720c0722c78df9ef4f0001cda9a6## Generated token: ##batsman:d9af96f7bddf441f295cbd326e010271## The way the hash is generated, only the maintainer of the script can verify it is valid and it was indeed generated by his/her script. Plus the votes are only valid for a limited time period. And you get a limited number of them. We can give matz "super voting powers" (his votes count triple or whatever) :-) We could ballot who has super voting powers. If Ruby ever takes over the world we could add another layer, and another, and... X-D -- _ _ | |__ __ _| |_ ___ _ __ ___ __ _ _ __ | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ | |_) | (_| | |_\__ \ | | | | | (_| | | | | |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_| Running Debian GNU/Linux Sid (unstable) batsman dot geo at yahoo dot com 'Mounten' wird f�r drei Dinge benutzt: 'Aufsitzen' auf Pferde, 'einklinken' von Festplatten in Dateisysteme, und, nun, 'besteigen' beim Sex. -- Christa Keil