grc-mode - Google Reader Client
grc aims to be a full featured Google Reader Client for Emacs. It currently supports many of the common features (reading, marking read, kept unread, starring, reading comments, etc.) with many others on the way.
Installation will be available via Marmalade soon but can be done manually by adding the following to your init.el/.emacs file:
(add-to-list 'load-path "path/to/grc") (require 'grc)
Once the code is installed and in your load-path, there are a few one-time tasks to do. Because grc uses OAuth2 as provided by Google, you need to register on the Google API site:
- Go to https://code.google.com/apis/console
- Click on “Create Project”
- Click on “API Access” in the left-hand panel
- Click the “Create a client ID” button
- In the dialog box that appears, click on the radio button next to “Installed Application”
- Click OK
- Use customize or add the following to your init.el/.emacs
(setq grc-auth-client-id "<client id>") (setq grc-auth-client-secret "<client secret>")
- Back in Emacs, enter “M-x grc”
- Emacs will redirect you to Google again, this time to get an authorization code.
- Follow the instructions on the page, and once you agree, copy the code back into Emacs (the minibuffer will be waiting with a prompt)
Whew! Happily that only has to happen the first time. Hopefully, in the future, Google will enable anonymous API access and registering for a client id won’t be required anymore.
grc will fetch a refresh token from Google. This is what will allow it to stay authenticated without the need to log in again. The refresh token is stored, by default, at ~/.grc-refresh-token. You can change where it goes via customize.
M-x grc-logout will remove the token and any cached tokens. You will have to follow steps 8-10 the next time you want to use grc.
The main entry point is “M-x grc”. If the grc command is preceeded with the prefix argument (“C-u M-x grc”) it will prompt for the type of view to load (Starred items, Shared items, Kept Unread, etc.). grc will load the results into the grc list buffer. Hit “?” for more information.
Hitting RET on an item will load it in the grc view buffer. Again, hitting “?” will provide more information about the available operations.
To have grc pull new items on a regular basis, add the following to your config:
(require 'timer) (setq grc-refresh-timer (run-with-timer 60 300 'grc-list-incremental-display))
Note, this won’t remove entries marked as read.
There are still some missing features that I am looking forward to adding (New Comments view, add comment, email, etc) and plenty of code cleanup to be done, but it’s usable now (I’m using it full time), so it seems like the right time to share.
Please fork, patch, offer suggestions, enter bugs, and enjoy!
- Missing features (email entry, edit/delete comments, probably more…)
- When using w3m to render the entries (will happen automatically if w3m is available) images take forever to load.
- A good dose of refactoring and code cleanup is needed.
Let me know what else you run into.
Here are some great resources and code for the (sadly) unofficial Google Reader API:
- grc began as an extension to the g-client greader provided as part of
the Emacspeak project @ http://emacspeak.sourceforge.net/
- Martin Doms has provided some useful documentation @ http://blog.martindoms.com/2009/08/15/using-the-google-reader-api-part-1/
- Mihai Parparita is providing some excellent unofficial documentation @ http://code.google.com/p/google-reader-api/w/list
- The Friends of the Google Reader API @ http://groups.google.com/group/fougrapi