Skip to content

Archive for


Lonava- A social news site in Python/Tornado

I spent a few weeks building an online Social News site to test some ideas, and thought some others might want to play with the code.

I’ll warn you that I’m while I’m adequate as an IT guy, I’m not a very good programmer. That said, you’re welcome to patch it, and submit changes back to the repo 😉


  • Posting News from around the web
  • Commenting on said news
  • Creating Channels (Subreddits/categories), and posting/reposting news into them.
  • Posting Images in comments and stories.
  • Importing News stories from RSS, Reddit, Digg, Hacker News
  • Automatic Sitemap generation
  • Show top Channels
  • Lots of other nice stuff.


  • It’s written assuming that you will be using Postgresql.

  • It calls Postgres everywhere it’s needed, not via a SQL pool
  • The name is hardcoded.

What it comes down to is that it wasn’t designed to be a generic engine, it was designed to run, but it should be portable with some regex work.

Take a look and let me know what you think. Hopefully it’s useful 😉

Sep retrospective

Last year I wrote a post with a theory on how to keep people Civil in online discussions, and to try to encourage people to post intelligently.

The central premise was that people acted better when they had to be responsible for their actions. As such, if sites such as Hacker News or Reddit were to force people to post under their Real, Legal names, the number of trolls would be dramatically reduced, and the signal-to-noise ratio would improve.

People who were simply posting to get a reaction wouldn’t want such posts associated with their name, but users posting lengthly, more blog-like comments would gain benefit by having such things turn up on a Google of their name.

This May, I decided to spend a few weekends testing the theory- I know a thing or two about IT, but I recognize I’m not a very good programmer. That said, I figured that it’d be better to put something together see if people responded, than to just pontificate 😉

I put together a site using Python and Tornado- I had initially tried using Rails, since I’ve used Ruby a fair amount in System Administration, but Rails felt too “Magical”.. One line to enable comments on a story, one other line to store things in a database.

Very, Very cool stuff, but too hard for me to wrap my little head around.
Tornado was, to me, simpler- Store data in SQL, use templates to write to the screen.
I can do this 😉

The hardest part of the process was the part that made Lonava Unique- Verifying names.
I had originally hoped to simply charge people credit cards $1, and match the name on the Credit Card against their username. As it turns out, however, no banks in the USA actually verify the name on a credit card.

I was sure that I must be missing something, but I checked with every payment processor that would answer my call- Paypal,, Braintree, and quite a few others. It’s just not do-able. The payment gateways would love to check it, but the banks don’t provide the information.

Lovely. OK, on to plan B.
There are a number of third-party ID verification solutions in the US, and if I cross-referenced the address (which is checked) from a credit card, I could be reasonably sure who you were.

  • Experian, the Credit Reporting people, have a really nice service, but they charge $5000 as an upfront fee.
  • Equifax charges $6000.
  • I didn’t note the exact number, but IDology was similarly pricey.
  • LexisNexis had the far more affordable price of $250/month, but first they needed to send representatives to my place of business to verify that our company was legitimate. Since this is a side project I was doing in off-hours, this wouldn’t really work

Eventually, I found Veratad. Their software isn’t designed for Identity Verification directly- It’s intended use is to find people who owe your company money, but they provided an API, so I could hack it into submission.

Each ID solution (including Veratad) also charged a fee for each lookup. Usually this was about $1, but varied depending on the number of requests you make.

After I was able to get the ID Lookup working, and Paypal Website Payments pro set up to accept the registration fee, I was good to go. I hacked up a basic version of the site, using Gruber’s grey, and the tables from Hacker News.

I think it looked great, but I think I’m an audience of one on this one 😉

The site worked, mainly, but the lack of content was deafening.

I worked with my friend Phil Martin to start scraping RSS feeds from around the web. Each RSS feed would go into it’s own channel, and people could subscribe to these, or to organic channels, such as “Technology News”.

I also wrote a standalone tool to import stories from Reddit, Digg, and Hacker News, letting people subscribe to specific Digg categories or Reddit Subreddits.

I also took the opportunity to “clean up” the design a bit. I added some rounded rectangles, and hacked up the CSS to use gradients. In this lesson, we learn why paying for designers is worthwhile

I showed the site to friends for feedback, and it was overwhelming.
The site was ugly. Unsavably-ugly. 6-drink minimum ugly.

I hired a designer to help put together a new version of the site- I’m really pleased with what we came up with. It’s got a lot more white-space, upvotes and downvotes are clearly separated from the content, and the user/channels/etc are all in place.

I spent another week of after-hours work converting his mockup onto the actual site, and added features I thought all good social news sites ought to have-Image Uploads, User-to-User messages, Nesting Support, and a bucketload of other features I won’t bore you with.

I used 99 designs to get a logo, which I had a lot of fun with. I really love the little guys, and expect to use them for another project down the line.

Finally, the site was ready to show off to the public.
It was still very MVP-level, and I wanted to see if anyone was interested before spending any more time on it.

Turns out, they weren’t 😉

I posted to Hacker News, twice. I bought advertisements on Reddit and Google Ads. I was able to generate a decent amount of hits (~5K), 10 registrations from friends, and 1 from a stranger.

1 registration.

This is how “Fail Fast” is supposed to work- The underlying Idea was flawed.. While it might provide better quality comments, people just didn’t want to post under their real name, and the particularly didn’t want to pay to do so.

Next steps? I’m not sure- I may re-tool the site, and use facebook-logins. That would solve the issue of paying for the site, but fundamentally, people like the anonymity.

I’ve put the code online; If anyone wants to make a go of it, they’re welcome to.
I’ve got a few other ideas in the pipeline I’d like to explore.