venus-ng
28 March, 2009venus-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:
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:
- I’ve changed the way it deals with passed-in urllib2 handlers
- I’ve commented out the HTTP 401 response behaviour (since I’m passing it an HTTPBasicAuthHandler already)
- 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.
Comments
Santiago Gala
28 March, 2009 at 11:19
Phil
28 March, 2009 at 13:02
Jack
16 April, 2009 at 11:57
Phil
16 April, 2009 at 13:39
Jack
16 April, 2009 at 19:58
Phil
16 April, 2009 at 23:23
Jack
17 April, 2009 at 09:15
Jack
17 April, 2009 at 09:17
Phil
17 April, 2009 at 12:08
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… 🙂
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.
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.
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/
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.
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! 🙂
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>
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).
OK, thanks. I have a more recent version at home which I’ve not committed yet. I’ll put it up tonight.