venus-ng

venus-ng is a fork of Venus which uses Newsgator to provide both the reading list and the feeds.

This means that venus-ng will, at a particular point in time, give you an accurate representation of your currently unread Newsgator feed entries. Here is the output from the newsgator.com web aggregator and venus-ng:

Screenshot of newsgator.com unread feeds Screenshot of venus-ng unread feeds

venus-ng does not mark feeds as read on the Newsgator server when in retrieves them, although that will likely get added when I have a test Newsgator account set up.

It is currently a fork because I’ve had to modify feedparser.py in a few ways which probably stop it working with other data sources:

  1. I’ve changed the way it deals with passed-in urllib2 handlers
  2. I’ve commented out the HTTP 401 response behaviour (since I’m passing it an HTTPBasicAuthHandler already)
  3. It always passes through an additional X-NGAPIToken HTTP header containing a Newsgator API key

As far as I can tell, the handler refactoring should be fine, but the 401-handling and extra HTTP header seem like a deal-breakers.

I have no idea how to stop the 401 handler in _FeedURLHandler() conflicting with that in urllib2.HTTPBasicAuthHandler.

I suspect there is a good solution in subclassing urllib2.HTTPBasicAuthHandler to provide the additional Newsgator HTTP header but I’ve not worked out some of the details yet.

You can get the latest source via bzr get http://philwilson.org/code/venus-ng – there is a sample newsgator.ini file in the /examples directory, but it relies on you already having a Newsgator account and some feeds set up.

Once I’d traced through the Venus code to semi-understand it, this was quite straightforward to do (deal-breaking fork-causers aside) so were Google Reader to introduce an official API it would not take long to integrate.

9 thoughts on “venus-ng

  1. I’m pretty convinced I shouldn’t need to do that – once you’ve managed to get an HTTP 200 from a Newsgator feed then you’re really just testing Feedparser rather than anything else since you’ve already successfully navigated the various Newsgator-specific authentication mechanisms. Of course, there should probably be some unit tests to check you’re actually getting that HTTP 200.

    It would be good, on the other hand, to keep the newsgator-namespaced elements from the feeds they provide (which indicate whether an item has been read or not, for example) and make them available to the Venus templates. A few unit tests would be good here.

  2. Turns out I can install wxwidgets, and wxvenus starts up fine, but just says ‘Welcome’, so I’m a bit stuck:- where in MainFrame.py should I be setting VENUS_DIR, CACHE_DIR and SOURCE_DIR? And, when I do, should VENUS_DIR and CACHE_DIR point to my existing venus-ng stuff? If so, er, what’s my SOURCE_DIR?

    Sorry for the possibly very dim questions – I know naff all about python.

  3. Oh, you shouldn’t have to do any of that – I do keep meaning to add this to the welcome page – just go “file->open” and point it at the .ini file you use to run venus. It will grab all the locations from there.

    Actually I recently hit a wall with wxVenus because it turns out the HTML renderer it uses on Linux doesn’t support CSS, but I’ll see what I can do anyway. Cheers for giving it a go! :)

  4. Loading up the .ini file sort of works – a list of my feeds appears in the top left pane, but clicking on them doesn’t do anything.

    Here’s the error:

    File "/home/jack/wxvenus/MainFrame.py", line 244, in OnFeedListSelect
    self.itemList.SetItems({})
    File "/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 11925, in SetItems
    self.AppendItems(items)
    File "/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode/wx/_core.py", line 11787, in AppendItems
    return _core_.ItemContainer_AppendItems(*args, **kwargs)
    TypeError: Sequence of strings expected.

  5. Oh, and thanks for your help! Having a nice way to read my feeds on the Eee has been a sort of holy grail since I got it (since the Newsgator web interface is like pulling teeth).

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>