Ruby Magnolia API Class
June 2nd, 2006
I mentioned in my last article that I had written my first official Ruby class and now I am ready to release it. I have been using Ma.gnolia pretty much since it came out. I love the fact that it stores copies of sites you bookmark so that you don’t have to worry about the site going offline. Ma.gnolia will always have a copy. I love API’s and Web Services and I knew it was only a matter of time until Ma.gnolia would release an API. Last weekend I had some time, so I started working on it.
I learned several things on this project. First, I got a better understanding of Ruby and Ruby classes. I used the alias method, declared a few things private and spent a lot of time dinking around with hashes.
Second, I finally took the time to learn RDoc. I am amazed at how easy and fast it is. I found myself spending more time crafting the documentation than actually writing the class (which I guess is a tribute to Ruby). I have uploaded the Addicted To Ma.gnolia RDocs for those who want to view them before snatching the code.
I also want to make it known that I am new to Ruby. I have no problem getting things to work but I often wonder if I am doing things the “best” way. So to any Rubyists out there, if you see ways to improve my code or documentation please let me know in the comments. This was half scratching an itch and half a learning project.
Nice job John, might have to port the magnolia picture linkroll service over to this.
Thanks Damien. Glad you like it.
Thinking about putting this into a gem with your newfound twitter fu?
This is a gem, but I haven’t created the command line interface to it yet. I’m thinking about integrating it with ruby-osa to actually search for bookmarks and then open a browser to the bookmark url.
I’m also thinking of adding some growlness to the new twitter gem (if it’s available that is).
That would be pretty sweet.
http://www.blogger.com/profile/17277354392047923200
[…] I created it because I had been dinking around with calling web apis in different languages I know (which aren’t Perl, cuz, Perl is work to me, other languages are play). I wasn’t quite digging the style of John Nunemaker’s Addicted to Ma.gnolia — there’s nothing wrong with it; for some reason I just wasn’t comfortable with implementing everything as class methods rather than instance methods. So I did my own, and while I was putting together I had a wonderful time watching it grow and then shrink, as I found minimalist ways of accomplishing things. […]