MaajReedr part 2 – putting it on a backburner

Today my task was to continue what I have started yesterday. My personal goal was to deal with the database and configuration. And hopefully rewrite recommendation algorithm from underscore.js to vanilla JavaScript. When I look back I have to say that I have underestimated this project a lot. It is not something I can finish in a day or two but I have to devote more time to it. For this week I am putting it on the back burner unless I’ll feel the need to work on it.

What stole most of my time were node.js’ asynchronicity features. I did not realize that there are two types of read/write operations. I saw them in the API documentation but I didn’t pay much attention until I was getting undefined when I wanted to log into database. Second time when I met asynchronicity was when working with the database. It was at the time I was sending content before it was ready. I wanted to save couple of lines of code but it didn’t work.

At first I was planning to use mongodb library for node.js but I couldn’t make it work. Therefore I later during the day opted for different library, mongoose. At the moment I am at point when I can read from database. From what I can tell from documentation saving to database isn’t much different.

The third thing which made scratch my head were nice URLs. I thought that those designed yesterday were good ones but after a second look they were really bad. And I didn’t realize that until I had to rewrite them. The structure I devised is:

Lesson learned today:

  1. Good tools are hard to find. I have spend a lot of time today to find a good database manager for MongoDB. I settled for MongoHub. The second thing I hate are text editors I use. I haven’t found one I like. Most of them are good enough not to opt for command line editors like nano but none of them are great.
  2. Seriously, when estimating time follow Scotty’s advice.
  3. Simple SQL commands were easy but mongoose’s way looks like more fun

MaajReedr part 1

For the first day I decided to “cheat” a little bit since it is a quite complicated project which I divided it into two, possibly three, small projects. The big project is a RSS reader for my Raspberry Pi with a recommendation system based on content-based filtering. I use node.js and MongoDB on back-end and nginx as a front-end.

Today’s main task was to create a parser for RSS feeds which I was unable to do with node.js’ external XML libraries. Secondary task was to go as far as possible.

I was able to finish main task with enough time to do a base work for interacting with the database, the only part of this project I have never dealt before, I mean MongoDB, I’ve dealt with several SQL databases before. I also did some work with node.js library Natural which I use for tokenization of either the description or the content of the post.

When it comes to RSS I decided not use all tags there are available but I used only bare minimum. In the futureĀ I plan to use atom features, such as updatePeriod and updateFrequency, but that’ll be sometime in the future when I tweak recommendation algorithm and user interface. It is not my top priority at the moment.

Tomorrow I plan to debug database which I was unable to do because I was away today from my working computer, to create user interface and rewrite and update recommendation algorithm from my own plugin for Mozilla Thunderbird which uses jQuery and underscore.js which provides functional helpers for JavaScript.

The pronunciation of this project’s name was ‘My Reader’, Czenglish, but I use ‘Maaj Reedr’ all the time.