we.b2.0.al.izr: The Making Of
posted in generator, hotness, php, web2.0 by Eric Doss on Thu Feb 23, 03:53 PMWhy Did You do This?
Last week, Richard and I were discussing the proliferation of private-beta sign-ups that we had encountered. Most of these sites had little more than a very vague description of the service and an email sign up form. Some examples dabble, dogear, and renkoo, and the most descriptive (if you can call it that) Noodly. I said “wow, you could almost build a simple form to build those simple forms” and then a lightbulb went on. Luckily I had a little time this weekend and was able to build what I like to call the we.b2.0.al.izr.
web2.0 version 1.0
The idea is to take information from a form ,mangle it a bit,combine it with random text and spit it out. Basically, it is a fancy version of madlibs. The first version was easy, I built a form and had it send to a php script that converted the name into a more web2.0 friendly title (i.e. replacing er with r and adding dots into it). It then generated a random number to choose which phrases to fill in around the buzzwords and technologies. I also had a list of color schemes to choose from. This information ported straight into the HTML and inline CSS. In the end it worked and I went to bed.
Cain’t we make it fancy?
The next day, Richard checked it out and liked it, but had a few minor criticisms suggestions. He thought that it couldn’t be web2.0 without rounded corners, so we decided to add the nifty corners script he loves so much. He also suggested making it so that you could reload your text with new random text or other colors. And, finally he thought it would be cool to be able to actually download the result as a html file. These ideas all stretched my minuscule mind, but I went to work researching a little php.
Form Fun
So, I wanted to be able to re-send almost all of the information that had been sent with the post. However, I needed to be able to choose not to send some things. I started thinking about the $_POST variable and realized it was just a normal array and that I should be able to spit it all out with a foreach statement (I know this should have been obvious but I am not all that smart). Also, I found out how to make a foreach statement use the array keys. So, I made a foreach that spit out each piece of data as a hidden form field, but I also used an if statement to get rid of the fields that I didn’t want to send. So, on the color randomizer I don’t send the color and on the text randomizer I don’t send the random number. This allows me to reuse the original script over and over without having to go back to the index page. I also made a form to send all of this information to the final page which I wanted to write out.
riting and rithmatic
Finally, I just wanted to make the script create the HTML and CSS files. I had never done anything like this, but it turned out to be pretty easy. I just created a new folder to hold the files and told the script to write the files there. It was as simple as fopen, fwrite, fclose. However, I started worrying that the folder would become very full of files that nobody was using. So to finish the whole thing off, I put a simple script on the index page that reads the files folder and deletes (unlinks) any file that is more than ten minutes old. I figure that page will be reloaded often enough to get rid of the old files. Actually, the more often it is used the more often it is cleaned out (kind of like my coffee cups aren’t).
This is the end
So after two nights of code we end up with a rather fun little script that I hope makes a few people laugh in the process.
I do have future plans, maybe the ability for people to add new technologies and buzzwords (if you have something you think needs to be on there, contact me). I might also multi-language support (the interweb is a big place, and wouldn’t it be great to see “Verschlagwortung durch Nutzer” in place of “folksonomies”).
But for now, to see the fruit of my labor check out the we.b2.0.al.izr.
PS
So, after thinking about it a bit and listening to Roman’s advice to Richard on the subject, I added a function to decide what type of name you want. this allows you to select a flickr style name (convert all the er’s , or’s, ar’s to just r) or a del.icio.us style name. In the del.icio.us style names, the app will actually look at the end of your name and decide if it is a tld. If it is a tld, it will give you a link to more information on how you can get than name (I didn’t know that there was a .er ). I think that this will make the app much cooler. I am also working on the collaborative business as well as the multi-language stuff. Well, enjoy.
2 Comments for “we.b2.0.al.izr: The Making Of” add yours!
Cool!.. Nice work….....
< Review: Ma.gnolia Is The New Del.icio.us | | Textplates: Why Working For Free Pays Well >
link
Blink
digg
tag
tag
Spurl
Furl
redd
vine
Cosmos
Wow people are really eating this thing up. I think that the function that searches all of the TLDs to find one that makes your site del.icio.us is the most unique part. I hope everyone enjoys it. I will work on it some more when I am back to civilization (i.e. not paying $2.50 for 15 minutes of internet)
E