philwilson.org

venus-ng

28 March, 2009

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.

See other posts tagged with general python syndication venus and other posts made in March 2009.

Comments

Santiago Gala
28 March, 2009 at 11:19

Now, as a test case, write a Newsgator scraper that turns it into an atom feed an use diff with the venus generated feed to check it really works… 🙂

Phil
28 March, 2009 at 13:02

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.

Jack
16 April, 2009 at 11:57

Thanks for this. I’ve been looking for a way to read my Newsgator-synced feeds offline on an Eee PC, and venus-ng works a treat.

Phil
16 April, 2009 at 13:39

If you can install wxwidgets on your Eee you can have an excitingly crappy desktop experience of your newsgator feeds via http://philwilson.org/code/wxvenus/

Jack
16 April, 2009 at 19:58

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.

Phil
16 April, 2009 at 23:23

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! 🙂

Jack
17 April, 2009 at 09:15

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

Jack
17 April, 2009 at 09:17

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).

Phil
17 April, 2009 at 12:08

OK, thanks. I have a more recent version at home which I’ve not committed yet. I’ll put it up tonight.