Kids are sick? Take coffee and code


I had some time since several nights (thanks kids to be sick…) to start watching how to implement a REST API using node.js (my new friend).

I plan to create an OW2 API this year; but before I started to wrap some existing services as proof of concept. The first feature focuses on how to get projects data from the gitorious instance we run at OW2. There is no clear API for gitorious but after some googling and source code search, it looks that there is a read-only XML API. Since I am targeting node.js, let’s translate this API into a JSON one: xml2js will do the job.

This results in a first library (gitoriou.js) which just call the gitorious instance and translates the XML data into JSON without any other data mapping. The following gist is showing how to get information from a project:

I talked about having a REST API, let’s use express.js for that and let’s run it on Heroku (this platform rules, just took 2 minutes to create, deploy and run the service and it is up at http://ow2apisample.herokuapp.com/).

To get information (as JSON) about the Jasmine project, just HTTP GET http://ow2apisample.herokuapp.com/project/ow2-jasmine

If you master any scripting language, you will be able to get all the repositories URLs from the JSON response, if not you can use the ow2git project to clone them all. Assuming node.js and npm are available on your system (you already have java, ruby and every other stuff installed, why not adding node?), you can install the binary:

npm install -g ow2git

and then clone all the repositories from any gitorious project

ow2git –clone ow2-jasmine

Will clone all the ow2-jasmine repositories into your current folder.

I am really impressed by node.js runtime, tools and community. Even if all of this is just a proof of concept, not really well designed, you can have something running quickly without many effort. Time to get something real. Soon…

2012


OK I am late for the ‘traditional’ past-year summary. So let’s do it short with 4 pictures…

OW2

OW2

I gave several talks at OW2Con 2012 and had fun like every year. I am also proud to be the new OW2 technology council chairman. There is just one thing to say: There are nice things to come this year!

OS X

OS X

I launched several OS X apps, just for fun and to get feedback from new communities. Check them out on the Apps menu. The end of the year has been busy but some updates are almost ready to be published, especially for my favorite app : QuickHub.

Linagora

Linagora, Open Source, Geek life

The big change of the year: Work. PetalsLink has been acquired by Linagora. Some good challenges and nice Open source stuff to develop in this new company. I am also always looking for new challenges and new languages to learn. I started the year with some ObjectiveC/Cocoa stuff as described above, then move to Ruby and finally finished the year with javascript and node.js development which is completely fun and easy to handle for a Java developer like me.

This is the most important thing of the year, no!?

Family

The most important thing of the year. Loris now have a sister: Mila.