KDE Google Reader

I’ve made a big progress with the upcoming libkgoogle 0.3 last weekend on the Fedora KDE SIG meetings which took place in Brno. I then decided to take some rest from all this Google things and wanted to relax by working on something else. But then I remembered that some time ago I experimentally implemented the Google Reader API and…well, see for yourself.

Originally I wanted to implement my own caching mechanism for the feeds, but I soon realized that I would be just wasting my time when there already is something as cool as  Akonadi.

I have written a simple Akonadi serializer for the data (took me about 20 minutes) and an Akonadi resource (that took me about 40 minutes to write). Finally I begun to write the client.

The client itself is very simple, it essentially only fetches list of streams (for those unfamiliar with Google’s terminology, stream == RSS feed) and their content from Google Reader and is able to update ‘read’ flag of one or more items. You can’t add or remove streams (maybe later).

Note: Do not try to “mark all as read” if you have too many unread items. The resource is sending a HTTP request for every single item (will be fix later, maybe…Smilie: ;).

But hey, what’s the difference between reading your feeds in a browser window or in a silly desktop client. To increase the level of (my) awesomeness I’ve made a Kontact plugin as well:

Btw, does anyone know how to change order of the items in the left pane? I’d like to have the reader where Akregator usually is Smilie: :)

In the first sync, the resource fetches up to 200 latest items form each feed (I think that’s a reasonable amount), then the updates are incremental. There is no progress indication, so just be patient.

In a way it is a “replacement” for Akregator  (but it lacks almost all of it’s features Smilie: :-), so actually it’s not…Smilie: ;). I suppose you don’t need to have local feeds in an RSS client when you can interact with feeds on Google Reader directly. On the other hand, it’s not a serious project, more like a preview or demonstration of power and awesomeness of the KDE technologies  (it’s so simple to use Akonadi!) and all the people behind it. When libkgoogle 0.3 is out and stable, I’d like to dedicate some time to help with the Akregator port (if it’s not finished until then), so this project will just rot in git, forgotten.

As I said, this is more of a tech preview, definitely not something for daily use. I won’t be spending much time working on it, but of course, feel free to clone the repo (see below) and contribute.

How do I get this?

1) You have to use libkgoogle from the experimental “reader” branch. This branch is rebased against the development branch of what-will-become-0.3, so it’s completely incompatible with the current resources from master branch.

$ cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_calendar=FALSE -DBUILD_contacts=FALSE

I recommend to install libkgoogle to some other prefix then /usr so that it does not conflict with the stable libkgoogle library, but if you feel brave enough, you can try to compile the branch with calendar and contacts resource as well, since they are mostly finished and working (and I would appreciate some feedback before releasing it).

2) Compile the Reader. The repository contains all the stuff – Akonadi serializer and resource, Kontact plugin, KGoogleReader KPart and KDEGoogleReader application (sorry for the KDEGoogleReader vs. KGoogleReader inconsistency, I couldn’t decide how to name it so I was mixing both names Smilie: :) )

$ git clone git://gitorious.org/kgooglereader/kgooglereader.git
$ cd kgooglereader
$ mkdir build && cd build
$ cmake ../ -DCMAKE_INSTALL_PREFIX=/usr -DLIBKGOOGLE_LIBRARY=/usr/local/lib/libkgoogle.so -DLIBKGOOGLE_INCLUDE_DIR=/usr/local/include/
$ make
$ make install #as root

Remember to replace the path to libkgoogle by wherever you have installed it. Now you should have kdegooglereader executable installed and when you restart Kontact you should see “Google Reader” in the left pane as well.

Well, I hope you like it Smilie: :)

Category(s): KDE
Tags: , ,

22 Responses to KDE Google Reader

    Alejandro Nova says:

    I’ll give you 100 internets if you import Akregator’s feeds into Akonadi, and mix Akregator with the Google reader.

  1. Please please get this into akregator Smilie: :) Awesome work your doing.

  2. Nice work. please find a way to integrate that into akregator.

    The google reader is the last part of googles api I can use in the same comfortable way on my desktop as on the browser side.

    Keep up the great work Smilie: :)

  3. Awesome, just awesome.

  4. Yes ! You must definetely integrate this awesome work in akregator ! at least until akregator sync with owncloud :p

    Keep up the good work !

  5. My vote for integration too!
    Good job, i’m looking forward to see libkgoogle too!!!

  6. Yes please get this working with akregator!

  7. So, did I understand it correctly that you have created an Akonadi resource for the google RSS service, and then created a standalone RSS reader which uses Akonadi as the backend, right? Indeed, it would be nice if you developed the newly created reader application to a point where it could replace Akregator.

    • I don’t have time nor the knowledge to work on something so feature-rich as Akregator. I made this really just to learn how to create an Akonadi client (very useful for my other project I’m planning Smilie: ;) ) and to point out how simple it really is.

      There are people working on Akregator 2 already, so I’ll rather help them, then just trying to make something myself.

    Christian Degenkolb says:

    i tried your recipe.

    the checkout of the reader branch of akonadi-google and building it went fine

    but i had to tell the cmake command of kgooglereader where to find LibKGoogleConfig.cmake with
    -DCMAKE_MODULE_PATH=/usr/local/share/apps/cmake/modules/
    but then
    in the make part i get
    [ 56%] Building CXX object akonadi_serializer/CMakeFiles/akonadi_serializer_kgooglereader.dir/akonadi_serializer_kgooglereader.o
    /home/xxx/Build/kde_rss/kgooglereader/akonadi_serializer/akonadi_serializer_kgooglereader.cpp: In member function ‘KGoogle::Objects::ReaderStreamItem* Akonadi::SerializerPluginKGoogleReader::doDeserialize(const QByteArray&Smilie: ;)’:
    /home/xxx/Build/kde_rss/kgooglereader/akonadi_serializer/akonadi_serializer_kgooglereader.cpp:55:3: error: ‘QVariantMap’ was not declared in this scope
    /home/xxx/Build/kde_rss/kgooglereader/akonadi_serializer/akonadi_serializer_kgooglereader.cpp:55:15: error: expected ‘;’ before ‘map’
    /home/xxx/Build/kde_rss/kgooglereader/akonadi_serializer/akonadi_serializer_kgooglereader.cpp:57:15: error: ‘map’ was not declared in this scope
    /home/xxx/Build/kde_rss/kgooglereader/akonadi_serializer/akonadi_serializer_kgooglereader.cpp:57:15: note: suggested alternative:

    did i do anything wrong?
    system is a kubuntu 11.10 with kde 4.8.0 from the kubuntu ppa

    regards
    christian

    ps: thanks for the effort i currently use rssowl to read my goole reader feeds but would really like to switch back (used to use akkregator) to something more kde Smilie: ;)

    • Missing include on my side, please try again now.

        Christian Degenkolb says:

        thanks. this was fast.
        ok the first problem went after a git pull away.
        however a new cmake and after that a new make gave the following error:

        [ 86%] Building CXX object akonadi_resource/CMakeFiles/akonadi_kgooglereader_resource.dir/settingsdialog.o
        /home/xxx/Build/kde_rss/kgooglereader/akonadi_resource/settingsdialog.cpp:23:31: fatal error: ui_settingsdialog.h: No such file or directory
        compilation terminated.
        make[2]: *** [akonadi_resource/CMakeFiles/akonadi_kgooglereader_resource.dir/settingsdialog.o] Error 1
        make[1]: *** [akonadi_resource/CMakeFiles/akonadi_kgooglereader_resource.dir/all] Error 2
        make: *** [all] Error 2

        and indeed there is only a settingsdialog.h and no ui_settingsdialog.h in the folder
        /home/xxx/Build/kde_rss/kgooglereader/akonadi_resource/

        regards
        christian

          Christian Degenkolb says:

          apparently there is a problem with an uic because before the mentioned ui_settingsdialog.h error i get

          [ 65%] Generating ui_settingsdialog.h
          uic: Error in line 39, column 40 : Unexpected attribute theme
          File ‘/home/xxx/Build/kde_rss/kgooglereader/akonadi_resource/ui/settingsdialog.ui’ is not valid
          [ 69%] Generating settings.h, settings.cpp

          in during make

          • Works for me with uic 4.8.0. Sorry, I don’t know Ubuntu at all, so I won’t be of much help here.

            But if you won’t figure out how to build it, you can always remove the problematic “theme” parameter Smilie: :)

            Christian Degenkolb says:

            i got uic 4.7.4 here.
            removing the “theme” tag solved the uic error. so building and starting worked.

            there are some error 404 with some of my feeds but i assume this is because of the early stage of libkgoogle and your reader.

            however thanks again for the effort this looks promising to become a real alternative to rssowl and akkreagtor.

            with regards
            christian

  8. Had a quick look at your Akonadi resource, very nice!

    One thing you could potentially do different is storing the time stamp of lastSync() into the collection’s remoteRevision instead of into the config.

    Simply run a CollectionModfyJob with the updated collection after item retrieval is done

  9. hi,
    I fixed the problem with compilation I had on my Debian. I don’t know if you remember, but with the repository package of qjson it was not working and neither was with the tarball. The problem with the tarball was just due to a corrupted .build-config file that I was using (the PKG_CONFIG_PATH for cmake was wrong).

    Now I am able to compile and run kdegooglereader. A stupid question, maybe given by the fact that I have never used libkgoogle. How do I configure the akonadi resource to access my account?

    • Hi,

      the reader should have a settings dialog, but apparently it’s missing for some reason, so you have to add the Google Reader resource via Akonadi Resource Configuration. When added, the resource should popup a configuration dialog where you can add your Google account (if the dialog does not appear – it happens sometimes – remove the resource and try it again)

      • I had added the resource through akonadi-console, but the settings popup wasn’t appearing. I removed the resource and added it again and now the popup does appear. Weird behaviour…

        • Frank managed to trace it down to a deadlock between the KGoogle::Auth’s mutex and KWallet’s event loop.

          Now it’s up to me to think of some nice way to fix it Smilie: :)

  10. Excellent work, as it adds the user & password gmail?
    http://i.imgur.com/X5kWy.png