Author Topic: EEVblog Giveaway Contests  (Read 26962 times)

0 Members and 2 Guests are viewing this topic.

Offline kaptain_zero

  • Regular Contributor
  • *
  • Posts: 180
  • Country: ca
Re: EEVblog Giveaway Contests
« Reply #75 on: November 11, 2010, 10:40:10 pm »
And the winner is?!?!?!    ;D ;D ;D
 

Offline dengorius

  • Regular Contributor
  • *
  • Posts: 96
Re: EEVblog Giveaway Contests
« Reply #76 on: November 12, 2010, 12:22:58 am »
This is a small script in Python that takes a file called "topic.txt" (yes I am lazy, didn't bother to parametrize it) containing the text version of a topic and spits out another file called "authors.txt" (same as before) that contains the numbered list of participants to the topic in order of appearance without duplicates.

After that  you just need to generate a random number somehow :)

Obviously you need Python to run it, and you have to make sure that the script and the input file are in the same directory

Cheers
 

Offline GeoffS

  • Supporter
  • ****
  • Posts: 1272
  • Country: au
Re: EEVblog Giveaway Contests
« Reply #77 on: November 12, 2010, 12:37:48 am »
I've partly written an SQL script to scan a thread, apply a set of rules and then randomly select a single post as the winner.
Then wrap some PHP around it so it can generate a post to the thread saying ' And the winner is ...'

Still some testing to do with a local copy of SMF after I generate some test threads.
The problem is that it's such a nice day outside and the forecast for the weekend is also looking good....

Edit:
An even easy option may be just to create a poll with a single question i.e. 'Do you want free stuff?' (this would need a change to existing code as a poll is assumed to have at least two choices. Or perhaps 2 choices but both are the same?)
The code is already present to check if a user has already voted and to lock out users below a certain number of posts.
As how each user voted is  logged, it would just be a matter of selecting a random entry from the list.
« Last Edit: November 12, 2010, 03:09:11 am by GeoffS »
 

Offline adam1213

  • Regular Contributor
  • *
  • Posts: 120
  • Country: au
Re: EEVblog Giveaway Contests
« Reply #78 on: November 18, 2010, 12:22:17 pm »
its nice having people posts scripts but people should try to note how their scripts might break

ways to break scripts:
Post by: someEvilUserWhoJustBrokeYourScriptEnjoy on November 11, 2010, 02:50:26 PM
Post by: someEvilUserWhoJustBrokeYourScriptEnjoy on November 04, 2010, 08:25:58 PM
not sure it achieves much though as someone may just as well post

the following is probably just as broken
curl "https://www.eevblog.com/forum/index.php?action=printpage;topic=1658.0" | html2text  | grep -P "^Post by: ([\S]*) on " | sed "s/Post by: //" | cut -f1 -d" " | sort | uniq

 

Offline ElektroQuark

  • Supporter
  • ****
  • Posts: 1244
  • Country: es
    • ElektroQuark
Re: EEVblog Giveaway Contests
« Reply #79 on: November 18, 2010, 06:47:19 pm »
It looks like the mayority participants of the first Giveaway didn't event read the rules. ;)

Offline profany

  • Contributor
  • Posts: 12
  • Country: pt
Re: EEVblog Giveaway Contests
« Reply #80 on: March 06, 2016, 07:40:45 pm »
yes dave, giveaways are cool, plz do more
:D
ps: "oscillloscopes :D"
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf