Belated 2-year anniversary (+ a code challenge)

edited July 2010 in Witch's Brew
Hooray!

2 years ago, plus 5 days, the Witch's Brew official site launched. Before that it was triple hosted by Mario, Geoff, and myself.

Anyway, I was thinking about making a random brew generator, but I know nothing of those fancy dynamic web-languages. So, if anyone can make a random brew generator, we'll totally make a page for it, and give you a super neat link with an icon next to it.

So, there...
«1

Comments

  • edited March 2006
    Something like this?
  • edited March 2006
    Hmm, perhaps something like that.

    Happy birthday, official Witch's Brew website!
  • edited March 2006
    Hmm... I was thinking more like grabbing random panels from their respective locations and creating a completely new brew.
  • edited March 2006
    I was thinking the same thing after reading the first post. It'd be great.
  • edited March 2006
    Done.
    See in action: http://huah.net/junk/randombrew.php
    Download: http://huah.net/junk/brew.zip

    It's a total hack, but all you need to do is copy randombrew.php to your base witchsbrew.org directory and open it. When you add a new comic, you can run nameharvest.php and it will generate a serialized php array that you can paste in the top of the randombrew.php file. If I spent a few more minutes on it, I could make it so that the serialized php spew is put into another file, but I've got a few other deadlines this morning. {grin}

    jason
  • edited March 2006
    Yes! This is possibly the best thing ever!

    "Feed me!
    With an acoustic jam!"
  • edited March 2006
    phasetwopert6jb.png
  • edited March 2006
    This is beautiful! I demand that Paul upload this immediately! Many thanks to you for your coding skills, Friend Jason.
  • edited March 2006
    I wish I had coding skills, or skillz.
  • edited March 2006
    I wish I had a monkey.

    Possibly one with coding skills/skillz.
  • edited March 2006
    08-04.gif

    10-13.gif

    Har!
  • edited March 2006
    You, uh, didn't link the images properly. Still, I corrected the URLs in my browser, and will throw in a small "har" as well.
  • edited March 2006
    **fixes urls on the doctor's behalf**
  • edited March 2006
    wow, this is totally sweet. On it.

    EDIT: tried... got confused... got it working... didn't want to spend the time adding random brew buttons everywhere... dedided this: I TOO DEMAND THAT PAUL UPLOAD THIS!!!! (him and his BBedit... he think his things he do are so cool.)
  • edited March 2006
    Dude, jason...

    this is the hottest thing ever... O_o
    Thank you so much, this will be implemented ASAP
  • edited March 2006
    Paul,

    I just now uploaded a newer version of the code...cleaned up, quicker, and a little more useful. Same location:
    http://huah.net/junk/brew.zip

    And there's now functionality in the randomizer to put something in the GET query and change the number of panels in the random comic generated, e.g.,
    http://huah.net/junk/randombrew.php?n=37

    jason
    <geeeeeeeeeeeeek>
    There are three files inside:
    brewharvest.php - now much faster and works on Dreamhost servers (which don't support file_get_contents for remote files). run this when you add new comics to witchsbrew.org. it generates a stream of gibberish that you paste into...
    brews.txt - text file of the serialized array
    randombrew.php - which is now much smaller because it reads from brews.txt. also has the GET query thing, which you can fiddle with if you want (currently min of 3 and max of 40).

    </geeeeeeeeeeeeek>
  • edited March 2006
    This is fun!
  • edited March 2006
    geoko wrote:
    **fixes urls on the doctor's behalf**

    Oh thanks much.
  • edited March 2006
    Oh yeah?!?!
  • edited March 2006
    Avast!

    walter7ne.png

    Has anyone else noticed that they are still ordered from oldest to most recent when randomized?
  • edited March 2006
    Random brew=AWESOME!!!!
  • edited March 2006
    Eww, he got LiveJournal all over his hands.
  • edited March 2006
    I never get any hilarious Random Brews... They do make me chuckle from time to time, however.
  • edited March 2006
    Has anyone else noticed that they are still ordered from oldest to most recent when randomized?
    DS, I suspect that this is a side effect of the quick-and-dirty use of array_rand() without shuffle() afterward. Should be an easy fix...unless it's better the way it is...?
  • edited March 2006
    would adding shuffle() take a long time? cause chronologically random brew would be more volatile...

    </whimpering request>
  • edited March 2006
    ...certainly not whimper-worthy! All you have to do, Paul, is add one line of code. After
    $brewsters_millions = array_rand($brew_array, $num_brew_bits);
    
    put the line
    $brewsters_millions = array_rand($brew_array, $num_brew_bits);
    [b]shuffle($brewsters_millions);[/b]
    
    and you're in business.
  • edited March 2006
    I'm all for chronological randomness. I'm really enjoying the Random Brews so far, and that would make it even more enjoyable.
  • edited March 2006
    Edited out for obsoleteness!
  • edited March 2006
    Sweet... We're in Chronological-Randomness Land now.
  • edited March 2006
    Both panels are from me, but it still warranted a chuckle...