//
you're reading...

Programming

Google Reader API for Cocoa

Today I have just made the world a slightly better place. Better for Mac developers, that is. That’s because I have made an open-source Google Reader library for Cocoa. You can download the library from Github: GReader-Cocoa and hopefully you’ll like it enough to contribute patches.

Why yet another Google API library? Two reasons why, which you’ll read in the following two paragraphs.

For one, in case you don’t notice, Google Reader API is largely unofficial. Google is yet to provide a “blessed” way to access data from Google Reader. Sure you can find a few blog posts that describes how to access their API, but I’ve tried these and a large number of them are either confusing or not accurate (probably out of date and thus unintentionally inaccurate). You can also try to reverse-engineer Google’s AJAX scripts and try to document them yourself. It could work – until Google changes their API anyway and by then you will probably need to do it all over again.

Second reason is that there isn’t any Google Reader library for Cocoa. I did found a number of example codes in Python, PHP, or even JavaScript. But none for Cocoa, especially Cocoa for the Mac which I needed to integrate News Anchor with Google Reader. Furthermore Cocoa is primarily a GUI-application programming language** and you need to do things rather differently than with a server-side back-end programming languages. Simply wrapping Python or PHP code into a Cocoa class won’t do.

Why open source it and not just keep it to myself? That goes back to the first reason: Google Reader API is still not official and I need help. Google may break this API and we need to make it a community effort to keep the library up-to-date, at least until Google provides an official API documentation and hopefully Cocoa library.

As of now GReader-Cocoa is still very basic, it only provides a way to list out your Google Reader subscriptions. There still a long way to go needed to make this a full-fledged Cocoa Library for accessing and manipulating your Google Reader account. Your contributions and forks are welcome.

Special thanks to pyrfeed that provide the documentation to get me initially going. But it looks like the way they pass the SID back to other API calls is wrong. You’ll need to pass a special HTTP header to authenticate with the Reader API instead of setting a cookie. I found out the answer for Google Reader authentication in StackOverflow.

** Yes, I know Objective-C is the language whereas Cocoa is the library, but one without the other is kinda moot.



Do you enjoy this post? Enter your e-mail address below to receive articles like this one in your mailbox.
* indicates required

Discussion

No comments yet.

Leave a Reply

Free Updates!

Learn how to grow your indie business while keeping your day job.

Categories

Archives

Keep updated!

Don't miss out on new articles!