Melange Lifestream Alpha

Melange Lifestream Alpha

Photo I wrote your startup's software in a weekend. Okay, sort of.

Of course, the activity feed isn’t a new idea. My previous employer Facebook has one of the first well-known activity feeds, and the concept has been spread all over the Web. Plenty of startups in the valley have based their entire business model on building a better recent activity feed, with some doing better than others. While focus may vary from multi-person (FriendFeed) to single-person (a blog lifestream, such as Jeremy Keith’s little script,) the feed is hot in Silicon Valley.

When building my identity site, estonbond.com, I decided that, I, too wanted a lifestream on my page. With Keith’s script too rudimentary in terms of features and architecture, I was left without a known solution. Of course, I could use some startup’s aggregation service, but I wanted something hosted that I could extend as I saw fit. What ended up coming out of it all was Mélange, a fully modular lifestream engine. While I’m hesitant to call this anything more than an “alpha” or “technology preview”, the architecture is reasonably sound and works well enough for most geeks to tinker with at this point.

What’s interesting about Mélange?

Mélange is a Creative Commons-licenced, open-source lifestream engine meant to exist solely for the greater good of the social developer community. Mélange is written in PHP5, with a heavily object-oriented architecture and uses standard methodologies such as a true object-oriented structure, PDO, PHP Exceptions, cURL, JSON, and XML. Mélange tries to be fully standards compliant. If none of this means anything to you, Mélange probably isn’t easy enough to use for you and I’d suggest you wait until it comes out of alpha.

For developers, the best part of Mélange is its entirely open, platform-based architecture. Mélange on its own is simply a logging kernel and a set of libraries — a framework, if you will — to building feed-type applications; all of Mélange’s power exists in its loggers, special objects that will retrieve data from external servers and pipe it to Mélange’s database architecture. To ease development of loggers, I’ve built and included a fully extensible RSS logger based on PHP’s SimpleXML library, giving you quick access to a data structure and useful functions to get items since a certain date, get specific items, and change the SimpleXML object structures into basic associative arrays.

For beginner PHP developers, I’ve also built example extension loggers off of the RSS logger for Twitter, Flickr, Facebook’s Posted Items, last.fm as well as a generic blog/RSS feed. All logger formatting is entirely extensible and editable, along with the rest of the architecture. Unlike hosted solutions, you can do whatever you want with Mélange’s codebase.

How does Mélange get data?

Mélange’s data mechanism is primarily pull-based, meaning that it uses cURL to go and search for RSS feeds and other APIs to get data back from them. For this purpose, Mélange can be manually cycled or set up on a cron job on your server; for example, estonbond.com attempts to harvest new data every 15 minutes using cron. For now, though, Mélange also supports a very basic push-based RPC format using a static API key. (Eventually, I’ll build out a true Mélange API, based on OAuth and other open, data-portable formats.)

So Mélange works standalone.

Yes, it can, but it doesn’t have to. Included with the Mélange Alpha is also a very basic version of a WordPress widget which will be eventually expanded into something more robust. For now, you can use the Mélange WordPress widget to display a very basic stream in your sidebar. Mélange, though, given its original purpose as being part of estonbond.com, was meant to be standalone in the first place.

How’s this about the community?

Due to its open-source nature, anyone may submit and maintain a Mélange logger. While developer support is minimal, you are certainly welcome to submit patched to me directly, and if they follow the coding standards and architecture of the rest of the Mélange engine, I’ll add them to the default download. Since Mélange is hosted on GitHub, you can always fork the code for yourself as well. Mélange isn’t just a weekend warrior’s project if you don’t want it to be.

As for the licencing restrictions, I feel the CC licences are more than open enough for most. Keeping the altruism alive, I certainly wanted to keep the project used in non-commercial cases. To compensate myself for Mélange’s development time, all I’m asking for in return from normal users is a link back to this page in your footer or site credits, stating that your lifestream is “Powered by Mélange.” As an active user of open-source systems and all-in-all a lover of what the social media community has done for me, I felt it was time to pay it forward.

Of course, I’m not the best engineer on the planet. I’m probably not the best engineer on my block, even. Because of this, I am willing to accept any optimisation patches or other such tweaks to the Mélange core — I’m not attached to anything other than the progress of this project.

Download Information

Mélange lifestream engine v0.1. Requires PHP5 and MySQL 4.1 or greater (MySQL 5.1.17 or greater recommended.) Recommended for web developers only.
(View Source Tree on GitHub)