I built a blog aggregator - waywework.it
I've been spending some time recently putting together a blog aggregator site for some of the folks I work with. Its now up and running at http://waywework.it. I hope this will be an interesting place to share our public community and as one of my colleagues said "this keeps my Google Reader much neater".
Today I'd like to talk about the code running this site which is posted and available on github at http://github.com/alexrothenberg/waywework.
I started thinking I would use an existing aggregator site and just apply my skin but when I did a quick search on github I most of the hard work existed in atom and rss gems and plugins and I wanted to take advantage of the just released Rails 2.2 so I decided to build my own. This turned out to be not too much work. Today I'd like to talk about how I put this together.
First I created my project with some scaffolding for feeds which would have_many posts
I soon found the atom gem and rss parser built into ruby. Using them was a piece of cake as all I had to do was create a method to call each one in my Feed model
Of course I had to create the glue wrapping it all together. A rake task to be call on a schedule
and the logic to load the feed, parse it and update the posts.
The next step was to publish an atom feed of my site. Again there was a plugin atom_feed_helperwaiting to help me. I installed the plugin and created a view builder
This was all so easy I had hardly done anything other than glue these plugins together. Now I finished up with a few bells and whistles.
I added a who's talking and archive by date section to my homepage that I called from my controller like this
I added security to restrict who can administer feeds
For the UI I am somewhat graphically challenged so got some help. For this github was very cool as I could add lessallan as a collaborator and he could check in his changes so they just appeared!
Finally a little work with capistrano (mostly just creating a Capfile) and I could deploy!
Overall I spent a few days and now have a site that does exactly what I want. Where most of the code I wrote is specific to my site and the general purpose plumbing was downloaded. I'm very pleased with the availability of plugins and gems and how easy it was to collaborate using github!
Now I just hope others find the site interesting to use!