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. :)

Thursday, July 21, 2011

Bus Route Finder

A month and a half back, I made a map of bus routes in Colombo that became a surprise hit. This, coupled with the number of calls Himal was getting asking which bus to take, made me think that a website that tells you which buses to take from location A to location B would be pretty useful. With my beginner-level knowledge of SQL, JavaScript and PHP, I was able to cobble together a website that helps you find the bus route to your destination.

The system is far from perfect (it has only 25 or so bus routes, from the 70 odd listed in the Colombo bus routes Wikipedia article), and so it could do with some improvement, which is why I'm releasing the source code and the database SQL under the GNU GPL. :) So, I hope someone who's better with buses and code can take this to the next level. So, do feel free to modify, change, and host as you please, and please excuse the n00bish code, I'm kinda new to this! :D

A better algorithm for finding buses would be really nice, since all buses are not created equal. Waiting for a 135 that never came on a Sunday afternoon in Narahenpita, or getting late for an appointment because some fool recommended you take a 255 (worst bus ever!!!) from Kottawa to Mount Lavinia, is uncool. A better system with some sort of ranking algorithm would solve this problem, me thinks. :)

Hope you guys find the system useful. There is a mobile version of the site, but my stupid web host won't let me automatically redirect users to it using htaccess. :( A special Thank You to all my friends who helped me with this, and especially Mr. Inosh Perera, who helped me with the 187 bus route and also suggested I add Google Maps geolocations to bus halts. :)

Update: Bus Route Finder on GitHub (Thanks, John!) :D

Sunday, July 3, 2011

I Know What You Did Last Summer

So, a couple of months have passed since finals and the university student inside me has been awoken from the long slumber that he took during the vacation months. Our fourth semester at SLIIT promises to be filled with challenges, the most important of which is the infamous "Second Year Project". We have been blessed with a great client, and it's now up to the group to deliver. This project offers us a chance to get our hands dirty with all aspects of the development process, from requirement gathering and analysis, to designing the system, to making databases, writing documentation, keeping the client and the lecturers happy with progress reports, as well as my favourite part - getting down and dirty with some mean code. ;)

The holiday months, alas, were not spent being entirely useless. :P I helped my friends at The Pooch Foundation by designing a website for them. When you're short on development time, bad code and design tends to seep through, and the website went through some horrid n00b html versions before coming out with the current iteration, which I quite like. The great thing about it is that it uses jQuery to look very, very good. ;) And the sad thing about it is that it uses jQuery, which tends not to run in some machines (like at uni), even if JavaScript is enabled. :/ But the project, as a whole, was brilliant. I learned PHP and jQuery on the job, and the intricacies of writing code for other people. ;) This new found love for PHP, coupled with something else has resulted in me working on a small project of mine, which I'll update you on within the week. :D Needless to say I am terribly excited about this, and it's something which -with enough user input- can grow into something that I hope a lot of people will find useful.

So, with the promise of blogging again in the not-too-distant future, I bid you adieu.