Cluffle – Wanna browse reddit at work? Make it look like Google.

Sometimes I have cool ideas, and from time to time I manage to actually use them to create something cool. Cluffle was one of them.

The basic idea was to simply build a page that looks exactly like one is it used from Google, but instead is used for browsing reddit. It may sound stupid, but in work environments it’s not uncommon to see Google on the coworker’s screen. Reddit, on the other hand, may cause trouble, as slacking off isn’t something welcome.

So I decided to pause my current project back then, and invest a few days into creating the page. In a span of one to two weeks I replaced some of my nights with coding and came up with extremely dirty, but working, code, which actually worked quite well – for one user.

The CSS was fine, but not responsive (mobile doesn’t need stealth reddit browsing). The JS was kept to a bare minimum, and the PHP was a structured mess. Reddit doesn’t use the classical pagination, but instead uses posts as reference to navigate. I was determined to make the number buttons on the bottom of Google work, so I decided to grab as many posts as I could (100 IIRC), and cache them. The alarm bells should start ringing by now for anyone who already experienced reddit’s love.

Unsuspecting me posted it to /r/internetisbeautiful, expecting a bit of interest and a lot of complains about my shitty code. Little did I know, it exploded. In a few hours, it went to almost 4000 points (~3950 as of now). I got more than a million clicks while the page was on rank one of /r/internetisbeautiful and rank ~30 of /r/all for a few days. My access logs went into the MBs. And my hoster on his knees. Sorry nearlyfreespeech.

As I mentioned above: I cached the first 100 posts of the current subreddit for every user. That shitty coding plus the flood of clicks ended in my page not being able to respond at all after the first few hours. It grew a bit over my head, so I decided to switch the hoster, poured 30 bucks into an alternative hosting plan from a bigger hoster (1und1) – and it still went down, even faster. After all, I could’ve guessed that nearlyfreespeech (which gives you as much ressources as you need as long as you pay for it) handled the requests better than the hoster which has a fixed maximum amount of ressorces. Anyways, I switched back to NFS, but quickly decided to take the page down. There was no use, reddit’s hug was too tight. I put the code, even in that state, on Github and a notice onto the page which notifies the user of the page being down and the code being accessible there. I also had to switch Google’s logo to a low quality selfmade one, after being notified by another redditor that it’s not allowed to use the original logo.

In total the whole project costed me about 2 weeks, a few nights and about 70 bucks (hosting at 1und1, hosting at NFS, domains). When I finally shut it down for good (after the hug of death I put it back up after a few days), I still had about 800 daily clicks.

Was it worth it? Hell yes. I learned about what to take care of before making a project public. I entertained a ton of people at least for a short time. And, most importantly, I got a boost of motivation to build the ideas coming after Cluffle.