Home > Hacking, Maemo > ReSiStance 0.8 with Google Reader support

ReSiStance 0.8 with Google Reader support

I delayed a bit ReSiStance development during last months because we had a lot of work in Igalia’s WebKit team. But I managed to find some time during Xmass to advance some work and to review a couple of pending patches. The most important ones were by far, the Google Reader support ones.

It all started with some sensational work done by Chus Picos. She did almost all the research regarding the status of Google Reader API (check here if you’re interested) and cooked a very nice set of initial patches. Thank you very much for the great work o/o.

Using those patches as basis, I fixed some remaining issues detected during the review process and implemented a couple of (IMHO) nice features I wanted on top. Basically with ReSiStance 0.8 you can:

  • One-click import of the feeds from your Google Reader account
  • Auto read/unread status sync with Google Reader as you read
  • Add new subscriptions to Google Reader
  • Remove subscriptions from Google Reader

Note that being a mobile app I tried to minimize network traffic as much as possible, and thus, no synchronization is performed automatically except the read status update as you read.

So this is how the main window looks like right now:

There you could see that the Google Reader patches came with a couple of UI changes. Zooming in the left part of the screenshot

unveils a couple of new UI elements:

  • a brand new cell renderer to showboth  feed title with subtitle and small Google Reader like icon for subscribed feeds (Planet Igalia and Fanhouse NBA blog in this case)
  • feeds without favicon now get a default RSS one (see Planet Webkit)

Now if we take a closer look at the rightmost part of the main window

we could realize that another new cell renderer was also developed to show the amount of unread items (and yes the background color is taken from the theme) inside a rounded corner rectangles.

Apart from the new UI items and the Google Reader support, there are a lot of other changes like connectivity improvements (with libconic integration), better exception handling, sorting fixes, duplicate entries detection…

Summing up, this new release not only adds some changes in the UI but tons of them in the guts of ReSiStance, so give it a try if you like it and tell me any bug you might find. Take into account that you need to setup the extras-devel respository in your N900 to have ReSiStance listed in the Application Manager. For those interested in the code, you can get it from the git repo as usual.

Categories: Hacking, Maemo Tags:
  1. ReinoutS
    January 12th, 2011 at 00:02 | #1

    I’ve installed it, but it takes forever while “Connecting to Google Reader”. How do I know if ReSiStance is actually doing something?

    • svillar
      January 12th, 2011 at 09:19 | #2

      Could you please open a terminal and and run ReSiStance from there? Just type

      $ resistance

      and tell me if some exception appears or not when synchronizing with Google Reader

  2. January 12th, 2011 at 00:30 | #3

    great application, thank you all!
    Still it seems a bit slow to me if one has a lot of feeds in it or one which is currently not reachable…
    Good old “grr” instead seems to get all the content of feeds via google reader so this way it only starts one connection and because of this is much faster, right?!
    Do you have any plan on using / providing this way too?

    @ReinoutS: Open a terminal and type “netstat -at”. If you see some hostnames corresponding to feeds you have in google reader, then resistance is definetly doing the right thing. It took quite a while on my device too.

  3. J.A.
    January 12th, 2011 at 08:45 | #4

    Yes, syncing with Google Reader is taking ages to finalize.

  4. svillar
    January 12th, 2011 at 09:25 | #5

    @m4lvin yeah ReSiStance still downloads the feed contents from the original sources and not from Google Reader. I do that in order to have the same code for all the feed sources. But if the difference is big I can think about that (patches welcomed BTW)

  5. Daniel
    January 12th, 2011 at 10:22 | #6

    Hi, it’s not that it takes many time to sync, but also the whole night and it has not synced at all.

    I’ve run it in the terminal and it’s first giving several message about not being able to connect to one feed and then a python exception:

    Could not establish a connection to http://03290234826429315468/label/Microsiervos
    Could not establish a connection to http://03290234826429315468/label/Microsiervos
    Could not establish a connection to http://03290234826429315468/label/Microsiervos
    Could not establish a connection to http://03290234826429315468/label/Microsiervos
    Could not establish a connection to http://03290234826429315468/label/Microsiervos
    Exception in thread Thread-59:
    Traceback (most recent call last):
    File “/usr/lib/python2.5/threading.py”, line 486, in __bootstrap_inner
    self.run()
    File “/usr/lib/python2.5/threading.py”, line 446, in run
    self.__target(*self.__args, **self.__kwargs)
    File “/usr/lib/python2.5/site-packages/ReSiStance/feedmanager.py”, line 632, in _add_feed_in_thread
    pixbuf = self._get_favicon_sync(new_feed_data.href)
    File “/usr/lib/python2.5/site-packages/feedparser.py”, line 236, in __getattr__
    raise AttributeError, “object has no attribute ‘%s’” % key
    AttributeError: object has no attribute ‘href’

    Could not establish a connection to http://03290234826429315468/label/Microsiervos
    Exception in thread Thread-41:
    Traceback (most recent call last):
    File “/usr/lib/python2.5/threading.py”, line 486, in __bootstrap_inner
    self.run()
    File “/usr/lib/python2.5/threading.py”, line 446, in run
    self.__target(*self.__args, **self.__kwargs)
    File “/usr/lib/python2.5/site-packages/ReSiStance/feedmanager.py”, line 635, in _add_feed_in_thread
    self._safe_callback(callback, pixbuf, new_feed_data, user_data)
    File “/usr/lib/python2.5/site-packages/ReSiStance/feedmanager.py”, line 121, in _safe_callback
    callback(*args)
    File “/usr/lib/python2.5/site-packages/ReSiStance/gui.py”, line 742, in _multiple_add_cb
    self._feed_added_cb(pixbuf, new_feed_data, row_reference, stop_progress=False)
    File “/usr/lib/python2.5/site-packages/ReSiStance/gui.py”, line 728, in _feed_added_cb
    self.FEEDS_MODEL_TITLE_COLUMN, self.view.get_feed_title_markup(new_feed_data),
    File “/usr/lib/python2.5/site-packages/ReSiStance/gui.py”, line 127, in get_feed_title_markup
    (DEFAULT_TEXT_COLOR, glib.markup_escape_text(unescape(feed_data.feed.title)))
    File “/usr/lib/python2.5/site-packages/feedparser.py”, line 236, in __getattr__
    raise AttributeError, “object has no attribute ‘%s’” % key
    AttributeError: object has no attribute ‘title’

  6. January 12th, 2011 at 10:33 | #7

    That looks nice! Do you think it would be possible to add support for the same features as for Google Reader, but for TinyTinyRSS this time? This app provides an API but I don’t know if it’s enough: http://tt-rss.org/redmine/wiki/tt-rss/JsonApiReference

  7. svillar
    January 12th, 2011 at 10:33 | #8

    @Daniel thanks for reporting. Actually some other guy told me about this. The problem arises with feeds inside folders. I’ll try to release 0.8.1 with a fix for that ASAP.

  8. svillar
    January 12th, 2011 at 10:36 | #9

    @Alexandre Franke looks great, I didn’t know about that aggregator. Yeah we indeed can think about that, could you please upload a bug for that here
    https://bugs.maemo.org/ ?

  9. Tomáš
    January 12th, 2011 at 11:51 | #10

    Nice application!

    “Note that being a mobile app I tried to minimize network traffic as much as possible, and thus, no synchronization is performed automatically except the read status update as you read.”
    Well, that is good, but a little bit unfortunate aspecially on wifi connection. When I launch RSS reader, I want to read what is new, so an autosync (I guess I mean update) on launch would be a nice feature (if it does auto-sync, it seems not to work for me).

    Also, is there a way to go to the source? Lots of feeds do not provide the whole text and insted they povide only a link – I would like to be able to follow those from the reader. Especially nice would be, if I could do it with multiple articles at once (i.e. I got ten new articles with links to source texts only, so I would get to open all of them in one action – similar to removing items in file manager)

    Also, if it were possible to view only unread items (i.e. automatically hide feeds that did not get updated) would be nice.

    • svillar
      January 12th, 2011 at 12:00 | #11

      @Tomáš It does not indeed autoupdate the feeds on startup. I could add that as an option for the next release.

      Regarding having a link for the source, yeah I’ll eventually add it. Need to think about the best UI for that.

      And filtering by read/unread status should also be possible.

      Could you please add these suggestions as three bugs in https://bugs.maemo.org/ ? That way I wouldn’t forget about them :)

  10. January 12th, 2011 at 14:01 | #12

    A native Maemo RSS reader that syncs unread status with Google Reader is my dream! Thanks for working on this.

    (I was unable to actually use it due to the “feeds in folders” bug mentioned above, will give 0.8.1 a try when it comes out.)

  11. Tomáš
    January 12th, 2011 at 15:44 | #13

    @svillar
    I have added all three, I hope you have luck with them. If implemented, I would fall in love with Resistance (so far, grr is better for me needs, but it is far from ideal and not actively developed – and the interface of ReSiStance is much better).

  12. January 12th, 2011 at 16:22 | #14

    @svillar

    I second the request for tt-rss support – I use tt-rss and it’s great. The mobile interface in tt-rss 1.5 actually works pretty nicely with the n900 browser, but a native client would be even better. I’ll check if the OP filed a bug yet, and if he didn’t, I will…thanks!

  13. svillar
    January 12th, 2011 at 16:29 | #15

    Thank you all for the very kind comments, and all the suggestions but specially for the quick testing. I’m really sorry for the feeds in folders bug, but it’s a bit complicated to cover all the cases when you don’t know the scheme of the xml.

    I’ve just uploaded v0.8.1 to maemo-extras with that fix. Hope it works for most of you.

  14. January 12th, 2011 at 16:31 | #16
  15. Mona
    January 12th, 2011 at 17:55 | #17

    It doesn’t want to work here… I can start the app, but tapping on the menu does nothing and I have to kill the program to be able to close it. This is what I get when running it from terminal:

    $ resistance
    Exception in thread Thread-1:
    Traceback (most recent call last):
    File “/usr/lib/python2.5/threading.py”, line 486, in __bootstrap_inner
    self.run()
    File “/usr/lib/python2.5/threading.py”, line 446, in run
    self.__target(*self.__args, **self.__kwargs)
    File “/usr/lib/python2.5/site-packages/ReSiStance/feedmanager.py”, line 442, in _load_in_thread
    self._safe_callback(callback, data)
    File “/usr/lib/python2.5/site-packages/ReSiStance/feedmanager.py”, line 121, in _safe_callback
    callback(*args)
    File “/usr/lib/python2.5/site-packages/ReSiStance/gui.py”, line 922, in _feed_data_loaded
    self.FEEDS_MODEL_SYNC_COLUMN, feed_data.sync,
    File “/usr/lib/python2.5/site-packages/feedparser.py”, line 236, in __getattr__
    raise AttributeError, “object has no attribute ‘%s’” % key
    AttributeError: object has no attribute ‘sync’

    Killed

    Do I need something in order to run it?

  16. svillar
    January 12th, 2011 at 18:17 | #18

    @Mona many thx for reporting. It’s indeed a serious bug. Expect a fix for that in 0.8.2. I’ll release it most likely during this weeked.

    If you cannot wait and feel like fixing it by yourself take a look at the instructions here: https://bugs.maemo.org/show_bug.cgi?id=11768#c3

  17. Mona
    January 12th, 2011 at 18:28 | #19

    @svillar
    Thanks for the fast reply :-) I’ll wait until the weekend then, as I’m no programmer…

  18. Mona
    January 12th, 2011 at 18:35 | #20

    lol… should have read the bugreport… thx to the good description I fixed it now :-)

  19. svillar
    January 12th, 2011 at 18:55 | #21

    @Mona I released 0.8.2 anyway with only that fix, as it’s really a blocker for users of previous versions

  20. ReinoutS
    January 12th, 2011 at 21:59 | #22

    The new version does actually start loading my Google Reader feeds but then crashes:
    Importing: http://blog.xebia.com/feed/
    Exception in thread Thread-23:
    Traceback (most recent call last):
    File “/usr/lib/python2.5/threading.py”, line 486, in __bootstrap_inner
    self.run()
    File “/usr/lib/python2.5/threading.py”, line 446, in run
    self.__target(*self.__args, **self.__kwargs)
    File “/usr/lib/python2.5/site-packages/ReSiStance/feedmanager.py”, line 657, in _add_feed_in_thread
    self._safe_callback(callback, pixbuf, new_feed_data, user_data)
    File “/usr/lib/python2.5/site-packages/ReSiStance/feedmanager.py”, line 121, in _safe_callback
    callback(*args)
    File “/usr/lib/python2.5/site-packages/ReSiStance/gui.py”, line 742, in _multiple_add_cb
    self._feed_added_cb(pixbuf, new_feed_data, row_reference, stop_progress=False)
    File “/usr/lib/python2.5/site-packages/ReSiStance/gui.py”, line 728, in _feed_added_cb
    self.FEEDS_MODEL_TITLE_COLUMN, self.view.get_feed_title_markup(new_feed_data),
    File “/usr/lib/python2.5/site-packages/ReSiStance/gui.py”, line 127, in get_feed_title_markup
    (DEFAULT_TEXT_COLOR, glib.markup_escape_text(unescape(feed_data.feed.title)))
    File “/usr/lib/python2.5/site-packages/feedparser.py”, line 236, in __getattr__
    raise AttributeError, “object has no attribute ‘%s’” % key
    AttributeError: object has no attribute ‘title’

    Cannot serialize to /home/user/.osso/resistance/feeds.db
    Exception in thread Thread-59:
    Traceback (most recent call last):
    File “/usr/lib/python2.5/threading.py”, line 486, in __bootstrap_inner
    self.run()
    File “/usr/lib/python2.5/threading.py”, line 446, in run
    self.__target(*self.__args, **self.__kwargs)
    File “/usr/lib/python2.5/site-packages/ReSiStance/feedmanager.py”, line 431, in _save_in_thread
    cPickle.dump(self.feed_data_list, db_file)
    UnpickleableError: Cannot pickle objects

  21. svillar
    January 12th, 2011 at 22:09 | #23

    @ReinoutS Guys I really appreciate your comments, but to report bugs, please use http://bugs.maemo.org.

    Regarding this issue @ReinoutS, what version are you talking about 0.8.1 or 0.8.2 ? I can import http://blog.xebia.com/feed/ perfectly. Do you mean adding that feed from scratch or getting it from Google Reader?

  22. ReinoutS
    January 12th, 2011 at 22:52 | #24

    @svillar
    Getting it from Google Reader, the xebia feed was the last one in a list.

  23. Tomáš
    January 13th, 2011 at 15:05 | #25

    By the way, I do not know if it is worth reporting as a bug – using 0.8.2., initial synchronization to google reader first shows lots of unread posts with each feed and corrects itself only after the synchronization is done. I.e. with each added feed from google reader, a certain number of unread posts is indicated. Only when the synchronization is complete (for all feeds), the number of unread posts is set right. It is a minor issue but it confused me a lot. Also it seems to me it slows the process a bit (ReSiStance downloads posts that already been read).

  24. svillar
    January 13th, 2011 at 16:42 | #26

    @Tomáš actually that’s not a bug. ReSiStance downloads the feed items from the original source, i.e, it downloads what the original source provides. After that we perform a read/unread synchronization with google reader in order to know what items were read in Google Reader. It’s not a bug to download items previously read. Many people store their read items, because they want to read it again or whatever.

  25. Tomáš
    January 13th, 2011 at 17:54 | #27

    @svillar
    Oh, I see. Does that mean that anytime you sync with Google Reader, ReSiStance first pulls all updates and then marks as read those that are unread in Google Reader? Well, I can see someone finds that useful. On the other hand, it is not very bandwidth friendly when on cellular, right? I would not mind if there were an option to download only unread items (if only because it is much faster to get updates then – I do most of my reading on a laptop and use the phone only occasionally), but it is not something I am terribly concerned about (and neither am I producing any patches).

  26. svillar
    January 13th, 2011 at 17:56 | #28

    @Tomáš yeah well, the library used by ReSiStance does not allow you to select which posts you want to download. You could do that with Google Reader API but I don’t want to change the way ReSiStance works unless the performance degrades a lot easily when using Google Reader.

  27. Ashley
    March 27th, 2011 at 08:35 | #29

    @Tomáš @svillar I have added a button to open the source post to the 0.8.7 code as available in the Maemo repos, but I would like to submit them to svillar first for approval and possible merging.

    If svillar approves, we could get this added to the trunk and rolled into the next package.

    I can supply a diff of the changes to constants.py and gui.py.

  1. January 11th, 2011 at 22:01 | #1
*