Showing posts with label kottu. Show all posts
Showing posts with label kottu. Show all posts

Wednesday, December 21, 2011

Blogger facepalm

How a human being likes to see an RSS feed:

Jerry's comment feed (Wordpress)

How a monkey generates an RSS feed:

Mein feeden (Blogger)

The reaction of the hapless programmer who's trying to parse comments:



I know, I know, parsers don't care about whitespace. But uuuugh, that fugly feed makes.me.want.to.tear.my.eyes.out.

Tuesday, October 11, 2011

On Kottu development, and oxygen for ideas

Kottu, after the 8.0 redesign

The thing with designing a software system you have no idea about is that you don't know how deep the water is, and you never will, until you jump right in. When Indi contacted me back in July with the proposal to join him at Kottu, I was stunned. It was truly a dream come true. I loved Kottu, Kottu was every young blogger's best friend. And it was where people could find good content, and sometimes even love

Coming back to the jumping in the water business: there is no way you can get something as complex and dynamic as Kottu right first time around. And I jumped right in, rewrote the whole code base from scratch. Every software best practice that I learned went flying out the window, and I cobbled up the least complicated thing that worked. No OOP, no comments, no nothing. Getting a working system out (no matter how ugly the code looked) was first priority. And only after going public with that did everything else flow along: documentation (still partial), code refactoring (check out the Posts class, which is basically what the whole back-end of Kottu looks like now) and more features.

When Kottu 7.8 beta first launched, we had no thumbnails, no categories and a bunch of those buggy Javascript social widgets that made loading the home page take ages. Only user feedback and time fixed those issues, and I don't think it is humanly possible for it to have happened any other way. Good systems don't just happen. Of course, there was UNIX, but let's not try to pretend we're Richie and Thompson, shall we? ;)

Right, then. The back-end of Kottu hit version 8.0 with some nice little refactoring (basically a revamped utils folder.) There are some development goals that I hope to achieve before we hit version 8.0 officially. (Note: These are not long-term goals like Indi has described here, but more of short-term, little, code-based goals)

  • Refactoring the front end

    There is a lot of code that gets duplicated in index.php and search.php and elsewhere in the front end. I hope to unify everything into a PageGen class to make generating pages easier and the code much cleaner.

  • Caching

    Kottu stupidly generates every page dynamically... every.single.time. I plan to put an end to this madness and store cached copies of several frequently accessed pages (or options within Kottu, say for example "Sinhala + Popular Today"). This would make me feel less guilty about running long and costly queries to give users a bit more of the beautiful data we have at Kottu. Don't tell anyone, but there will be graphs! ;) Shh!




  • Better documentation

    If you ask people why many open source projects fail, they would say that the two primary factors are developers losing interest, and lax user documentation. I've been a typical programmer, and been slacking off when I was supposed to be writing the f@#%ing manual (couldn't resist, sorry!) :D Yeah, there is a nice little markdown file on our Github, but we need more, including better on site documentation (not about the code, obviously, but think of a better About Us page).

  • Not-so-active blogs, what is?

    Okay, so there are active bloggers, and there are not-so-active bloggers. Thing about Kottu is we're dealing with limited resources, servers that might melt sooner or later, and other real world problems. We currently have 907 blogs listed on Kottu (wait, I'm sure that number was higher... dafuq?). What does FeedGet.php do? It takes 50 blogs (least recently polled), goes to each of those RSS feeds and adds any new posts to our database. Now, FeedGet.php is cronjob'd to run every 5 (!!!) minutes, the minimum limit allowed by our hosting provider, but still it takes approximately 1 hour 30 minutes to repoll a feed. So, if we polled your feed just before you posted a blog post, then sorry.com, bro. You will have to wait for one and a half hours for your blogpost to appear on Kottu. (We can't poll more that 50 feeds at a time due to the fact that PHP is a freaking crack addict that gobbles up insane amounts of memory without de-allocating any)

    What do we do now? What do we do now that doesn't get me banned from the next blogger meetup? Maybe we should poll not-so-active blogs less frequently, giving priority to active blogs - which are more likely to have new posts. And as soon as a less-than-active blogger makes his comeback, his blog is made active again, and gets polled in the usual way. It's sort of evil, yes, but necessary if we're to increase the response time of Kottu. And it also encourages bloggers to be more active. Whaddaya think?

So, finally, don't let the version numbering and jibber jabber fool you. Kottu is pretty much a work in progress, and Indi and I will continue to tinker and attempt to make it better and faster and cuter. And hopefully, I will realise my dream of a happier, friendlier, active little Blogosphere, like we had back when I first started in February 2009. Those were the days, maaan! :')

P.S. The title of the post is from an awesome awesome article by the guy behind Wordpress. READ IT! It totally changed the way I view software, and contributed to numerous bugs on Kottu, and I highly recommend it for anybody, geek or Greek. :D

Tuesday, September 6, 2011

Chavie who?

Soooooohhhhh, it took a complete GUI redesign at Blogger to bring me back to these parts huh? :D

Welp, I have been a biiit busy, ostensibly working on Kottu (a hora sneak peek at a new feature I'm working on here), but actually just doing nothing or catching up with Sai, WHO'S FLYING DOWN FOR GOOD THIS MONTH! Yaaaaayayayaya!!! :D

There are so many things to tell, so much to blog about, but ugh, goddammit this blogger interface is too shiny and distracting... I wonder what this button does...

ZZAAAAPPPP! :O

Ok, lame jokes aside, I came here to write about how signatures are crap. I mean, I had the misfortune of going to the bank today, and the poor lady in front of me had put her signature a bit too longer than what was on her book thingy. I mean, wtf man?! How do people manage to keep their signatures looking the same? Mine changes like a gazillion times a day (anyone looking at the uni class register would understand) and I actually practice before going to the bank, and still mess up horribly. I mean, in an age where retina scanners and fingerprint readers are freely available, ugh nevermind... -_______-

So, anyways, good to be back. Will hang around this time, I guess, since working with Kottu means I get to visit your blogs quite a bit these days. We're rolling out a few new features in the next few days, so stay tuned to Indi's blog! :D

Wednesday, August 24, 2011

The new Kottu beta

Kottu is the Sri Lankan feed aggregator we all know and love. Kottu currently has more than 1000 Sri Lankan blogs in all three languages (and one Dhivehi blog too!) listed, and it's safe to say that without the community and traffic built up around Kottu, most of us would never have continued blogging. Indi, who basically set up and ran Kottu from scratch with his own money, contacted me last month to see if we can spice it up a bit, and add some new features to the site.

Introducing the new Kottu beta

Screenshot

One of the most popular features of Kottu, that sort of got hijacked and removed, was the popular posts widget in the sidebar. We wanted to re-implement it, without relying too much on clicks and relying more on social media (something that wasn't that huge when Kottu first launched). So now, you can basically click on the popular posts (categorised by time - today, this week, this month) in the sidebar and it shows the most popular posts in that time period. (Note: Don't be angry if your popular posts don't show up, we just set the system up and stats are only being counted from yesterday). Another feature is language based filtering, which makes it easier to find what you're looking for. 

The technology 

There isn't much behind the interface, really. We use SimplePie to read the feeds and get new posts, the Twitter and Facebook APIs (the latter through the Facebook PHP SDK) to get stats, and combine them using a very simple formula:

Post Buzz =
(No. of tweets / Max tweets for a single post in the last 24 hours) + (No. of FB likes and shares / Max) + (No. of clicks / Total no. of clicks)
(with appropriate weight given to each metric) 

So basically: The more tweets / Facebook likes or shares your posts get, the higher ranked it will be.

We also use something called Fizzling to reduce buzz as a post gets older. This follows the logic that the older a post is, the more tweets / FB likes or shares it should get (if it's good) and therefore, to give newer posts a chance, we counteract this with the negative influence of age on the post buzz.  

So, finally

Use it. It's at kottu.org/beta. Let Indi and I know about what you think. Our hope is that this will help in some small way to rejuvenate the local blogging scene, which is nowhere near the glory days of 2006-08. And we can hopefully iron out the issues and take this out of beta in the next few weeks. :)