Hate on Your Job
Those around me and following me on twitter are likely already have heard me rambling on and on about my new site, Hate On Your Job. For those of you that haven’t, I’ll explain the premise, as if it’s not blatantly apparent. The idea cam from being frustrated at work one night, and generally, I vent my frustrations out on Twitter. However, I quickly recalled all of those stories you hear about people getting fired for saying something absolutely stupid on Twitter. Wanting to keep my job that night, I opted to just not tweet my frustrations on that particular topic. After all, it was a fleeting moment not really worth the words, and customers of Contegix, along with co-workers (And my boss), follow me on Twitter. It wouldn’t have been very intelligent to make such a stupid tweet. Then I thought about how nice it would be if there was a place to make the same tweet, but without the consequences. Thus yet another site was born.
To keep things “tweet-like” I forced a character limit of 200, because 140 didn’t seem like enough to really say what you had to say. I had to be able to link the hates to something, so we obviously have the companies that our hateful entries belong to. Finally, each company belongs in a category, allowing for somewhat easier browsing. A full listing of companies is probably still going to be necessary at some point, which is something I’m looking into. Obviously, implementing it isn’t difficult at all, thanks to our wonderful friend Django. I guess I’m more or less looking for a graceful way to present all the companies in one giant (paginated) list that doesn’t look ridiculous. Between the recent company list, the search feature, and the categories, finding companies isn’t too problematic though.
I do owe some major props to a few people. First and foremost, Mike Bishop of The Able Few for the amazing design he whipped up for the site. It loads with the quickness, it’s easy to read, and just looks fantastic. Definitely better than the original design that I haphazardly slapped together :). I also leveraged a few Django add ons as well that saved me ample amounts of time. I knew I was going to need some form of CAPTCHA to prevent bots from owning my site, so I checked the glorious Interwebs to see what I could find. I figured it wouldn’t be too hard to leverage PIL to come up with something on my own, but what’s the point if someone’s done it already, right? I opted for Django Simple Captcha. It had decent enough of documentation, appeared bug free in my testing, and has been pretty solid thus far. I had to make a few manual edits to the app itself in order for it to work fine in Python 2.4, and to extend the string length. Basically, time spent messing with captcha was reduced to about 25-30 minutes. No complaints here!
Then I decided I’d like to have some form of voting system, but at the same time I didn’t want user accounts. After all, this is anonymous, so user accounts are the wrong way to go. Since I didn’t have a session, that made voting incredibly exploitable. At first, I thought “Maybe the honor system will work”, and just had the most basic vote system in place. Basically, you could sit there and vote all day if you wanted to, over and over and over again. I didn’t think it’d be a problem, until a friend of mine thought it’d be funny to setup a curl in an infinite loop, and watched the votes sky rocket. Obviously, the honor system is flawed, and I knew it would be. Call it wishful thinking I suppose. Hence, I dug around a bit to see what my options were. I didn’t want to tie votes to IP addresses, since that’s going to have a problem for people behind NATs. I didn’t want to create a situation where a whole office gets to vote all of once, didn’t seem fair. That’s when I found Django Secret Ballot. It creates a hash based off of the user’s user agent, and injects that to the cookie. All votes by that user are then tied to that. So far that’s been working quite while, and has been curl proof thus far.
Lastly, I also leverage the python-twitter package as well in order to push new hate entries off to Twitter. Why create an RSS Feed system when Twitter can basically serve as an RSS feed for me? Besides, I think people use Twitter more than RSS feeds nowadays. If you’re interested, follow @hateonyourjob. It was kinda fun putting that in place though, since Twitter was down during my testing. Of course the very last thing I checked was for Twitter being functional and instead hacked my code to pieces four or five times first. Way to go me, eh?
Anyways, I really just wanted to document the “making of” the new site. Hope you enjoyed it, and hope you enjoy the new site.