info-gnus-english
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using gnus and nnrss for reading bloglines subscriptions.


From: Neeraj Bhope
Subject: Using gnus and nnrss for reading bloglines subscriptions.
Date: 27 Oct 2004 22:35:42 -0700

I used some code from nnrss.el for using the bloglines api and reading
bloglines subscriptions in gnus. Right now it is mostly a hack hooked
up into nnrss-extra-categories which by default gets categories from
http://w.moreover.com/categories/category_list_rss.html.

If nnrss-extra-categories is set to the function
nnbloglines-snarf-categories and one hits 'B nnrss RET RET' in the
group buffer then it will download the opml subscription listing from
http://rpc.bloglines.com/listsubs and modifies the nnrss-server-data
list. The bloglines api uses basic auth with the username password
being the ones you use for your bloglines account. For some reason
using nnrss-fetch to get the parsed xml is problematic because the
basic auth username-password prompts do not come up. I have not been
able get around this and so before using the following code I just do
a (url-retrieve "http://rpc.bloglines.com/listsubs";) that it prompts
me for the username and password and stores it for later use. Once
this is done everything goes well and one gets a list of the bloglines
subscriptions and then one can subscribe to some category and then
pressing RET will show the articles in the group which are obtained in
the RSS feed using nnbloglines-getitems-url with the subscription id
given by the attribute BloglinesSubId in the opml. However once I quit
gnus the next time I cannot read any remaining articles as I get a
message that the group has zero messages. I debugged and found that
this is because the groups created are ephemeral.

So the following are the main problems that I am facing and would like
ideas about them:
1) How to get the basic auth prompts?
2) How to make the groups persistent?
3) Is this the right way to implement this? should this be factored
out into a separate gnus backend?

(require 'nnrss)
(setq nnrss-extra-categories '(nnbloglines-snarf-categories))
(setq nnbloglines-url "http://rpc.bloglines.com/listsubs";)
(setq nnbloglines-getitems-url
"http://rpc.bloglines.com/getitems?s=%s&n=0";)
;;shameless copy of nnrss-snarf-moreover-categories with some minor
;;modifications.
(defun nnbloglines-snarf-categories ()
    (let (category name url changed)
      (nnrss-read-server-data "")
    (with-temp-buffer
      (let ((outline (nnrss-fetch nnbloglines-url)))
        (dolist (outline-el (nnrss-find-el 'outline outline))
          (if (equal (xml-get-attribute outline-el 'xmlUrl) "")
              ;;This is an outline element describing a folder and not
              ;;a subscription. So ignore it.
              ()
              ;;The title is stored as the group name
            (setq name (xml-get-attribute outline-el 'title))
            ;;Format the rss feed url for the group with the BloglinesSubId
attr.
            (setq url (format nnbloglines-getitems-url 
                              (xml-get-attribute outline-el 'BloglinesSubId)))
            )   
        (unless (assoc name nnrss-server-data)
          (setq changed t)
          (push (list name 0 url) nnrss-server-data)))))
    (if changed
        (nnrss-save-server-data ""))))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]