News for hackers. Stuff that matters.
Re:Double your userbase with two lines of code and a box of ... by MobileDigit on Monday April 30, 2007 @01:50PM (#18178)
"if I were launching a new website, here's what I'd do. Instead of hiding the Feedback link in the upper right hand corner, I'd place a form right on the main page. A big form. And I'd bend over backwards to get people to use it."

What are the two lines of code to produce this?

Re:Double your userbase with two lines of code and a box of ... by brlewis on Monday April 30, 2007 @02:21PM (#18186)
I'd like to know too. You could do something like the following, but that would mean an ugly email message and ugly thank-you page.

[(define-input feedback) (mail '("foo@bar") feedback)]Thank you for your input.

Re:Double your userbase with two lines of code and a box of ... by randallsquared on Wednesday May 02, 2007 @03:51PM (#18818)
The thank-you page isn't really code, so even though it might be hundreds of lines of HTML and CSS, it's the web designer's responsibility, not the coder's. :)

The code for the thank-you page could be as simple as:

import smtplib

smtplib.SMTP('127.0.0.1').sendmail('[email protected]', ['[email protected]'], "From: [email protected]\r\nTo: [email protected]\r\n\r\nMessage follows: %s" % (web.input.get('feedback', 'NOTHING'),))

Not sure it that will work without a .quit(), but then you'd have at least 4 lines. Well, that's what local libraries are for. :)

Re:Double your userbase with two lines of code and a box of ... by Alex3917 on Monday April 30, 2007 @07:13PM (#18239)
Don't take the headline too literally. :-)