MozillaZine

Need help with RSS reader

Talk about add-ons and extension development.
engmike8

User avatar
 
Posts: 40
Joined: January 25th, 2003, 8:37 am

Post Posted April 11th, 2004, 8:17 am

could someone help me figure out why this feed isnt working?

http://x-prize.blogspot.com/atom.xml

i've added it to the rss reader extension side panel, but when i click on it i get an error message

"We're sorry but the Username/Password combination you've entered is either invalid or you don't have permission to access this Blog. "

I can view the blog without any problems, anyone know how i can get it working? Thanks

John Liebson
 
Posts: 6491
Joined: July 29th, 2003, 1:09 pm

Post Posted April 11th, 2004, 10:04 am

All I can tell you is that I just added this to my copy of the RSS reader, clicked on it, was quickly shown the contents of the site, using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7b) Gecko/20040410 Firefox/0.8.0+--which does you very, very little good, alas.

jrduncans

User avatar
 
Posts: 316
Joined: September 16th, 2003, 7:22 pm
Location: Norfolk, VA, USA

Post Posted April 11th, 2004, 3:25 pm

I'm having the same thing happen to me with my Atom feed for my site. It works fine to click on the overall site if you have the "show in content area" option checked. But individual posts don't work. I'm currently using Blogger as well, so it's probably something to do with how Blogger generates Atom feeds...

John Liebson: does it work when you click on a single post in the bottom side panel?

John Liebson
 
Posts: 6491
Joined: July 29th, 2003, 1:09 pm

Post Posted April 12th, 2004, 4:24 am

jrduncans wrote:John Liebson: does it work when you click on a single post in the bottom side panel?

As I wrote previously, I only tried to get to the site, I did not actually try to read anything.

So, seeing your question, I put the feed back into my RSS feeds, and, no, I cannot actually read any of the individual feeds: If I click on one in the RSS side panel or in the main screen, I get the odd message about passwords, etc.

farmerchris
 
Posts: 31
Joined: June 16th, 2003, 11:54 am

Post Posted April 12th, 2004, 7:58 am

The RSS reader as it exists now does not support Atom feeds quite right. There are several types of <Link> tags in Atom, and only those with the rel="alternate" attribute are considered hyperlinks. However the RSS Reader extension always assumes that the first Link is the correct hyperlink and uses that. For some sites, the first Link leads to a page for editing the text, rather than viewing it.

I have made a few changes to the RSS reader code to fix this, but I don't have time to post right now. I'll do it after my morning meeting. :)

farmerchris
 
Posts: 31
Joined: June 16th, 2003, 11:54 am

Post Posted April 12th, 2004, 8:28 am

Ok, here is a fix for Atom feeds. You'll have to edit the rssreader.js file, which is contained in rssreader.jar.

Replace the function createRssObjectAtom with this code.

Code: Select all
// ATOM
function createRssObjectAtom(){
    for(var i = responseXML.documentElement.firstChild; i!=null; i=i.nextSibling){
        if(i.nodeType != i.ELEMENT_NODE) continue;
        switch(i.localName){
            case "title":
                rssObject.title = CommonFunc.getInnerText(i);
                break;
            case "link":
                if(rssObject.link){
                    if(i.getAttribute("rel") == "alternate"){
                        rssObject.link = i.getAttribute("href");
                    }
                }else{
                    rssObject.link = i.getAttribute("href");
                }
                break;
            case "tagline":
                rssObject.description = CommonFunc.getInnerText(i);
                break;
        }
    }

    var entryNodes = responseXML.getElementsByTagName("entry");
    for(i=0; entryNodes.length>i; i++){
        var rssItem = {title:"", link:"", description:"", content:""};

        var titleNodes = entryNodes[i].getElementsByTagName("title");
        if(titleNodes.length) rssItem.title = CommonFunc.getInnerText(titleNodes[0]);

        var linkNodes = entryNodes[i].getElementsByTagName("link");
        if(linkNodes.length) {
            for (j = 0; j < linkNodes.length; j++)
            {
                if (linkNodes[j].getAttribute("rel") == "alternate")
                {
                    rssItem.link = linkNodes[j].getAttribute("href");
                    break;
                }
            }
        }
       
        rssItem.content = getAtomContent(entryNodes[i]);
        rssItem.description = htmlToText(rssItem.content);
        rssObject.items.push(rssItem);
    }
}


If you don't know how to edit this file, email me at (farmerchris at 123mail dot net) and I will send you a new rssreader.jar with this fix and a few others. (I have also fixed a bug that causes the text in the contents pane to be invisible if there is a hyperlink at the start of the summary.)

Please let me know whether this helps solve the Atom problem.

Edit: fixed formatting.

babba
 
Posts: 79
Joined: June 8th, 2003, 8:17 am

Post Posted April 12th, 2004, 11:07 am

Thanks for the fix it worked for me.

Edit:We are waiting the few others also.Your extension is one of my favorites,i m using it since xmas.

farmerchris
 
Posts: 31
Joined: June 16th, 2003, 11:54 am

Post Posted April 12th, 2004, 12:09 pm

I must confess I am not the author of this extension. Just a big fan, who didn't think these bugs would ever get fixed.

Here is my other important fix. This prevents the contents page from getting corrupted in certain situations. You may never have seen this, but I saw it often. Here's an example: http://radio.weblogs.com/0112482/rss.xml . My CSS file somehow rendered entire sections as invisible text, but YMMV.

When a rss item has no description, the first 20 characters of the text are used as the title. Sometimes though, the first 20 characters are actually the start of an HTML tag, like a hyperlink. This causes the display to get messed up. Here is some code to strip out hyperlinks before creating the title...

In rssreader.js, find createRssObject() and replace this

Code: Select all
  rssItem.title = rssItem.description.substring(0, 20) + "...";


with this

Code: Select all
  tempStr = rssItem.description.replace(/<.*?>/g,'');
  rssItem.title = tempStr.substring(0, 30) + "...";


I have left a message on the author's forum about these bugs and their fixes, but I don't know how to contact him directly. (I don't read Japanese, unfortunately.)

babba
 
Posts: 79
Joined: June 8th, 2003, 8:17 am

Post Posted April 12th, 2004, 1:24 pm

I see what you mean and it fixed also.Nice work and i wish you find a way to communicate with the japanese author somehow.This extension has some good feature IMHO.

engmike8

User avatar
 
Posts: 40
Joined: January 25th, 2003, 8:37 am

Post Posted April 12th, 2004, 3:38 pm

that fixed it, thank you! I figured out how to do it myself, got it right the second time, i changed both parts that you posted, and it works with out any problems. good luck getting in touch with the author.

engmike8

User avatar
 
Posts: 40
Joined: January 25th, 2003, 8:37 am

Post Posted April 12th, 2004, 3:40 pm

what were the other fixes that you have added? It not a big problem but for some reason everytime i check for updates, these two feeds are always always show up "question marks" even if they are updated, or havent been.

http://www.engadget.com/rss.xml

http://blo.gs/3186/favorites.rss

thanks a lot for youre help!

farmerchris
 
Posts: 31
Joined: June 16th, 2003, 11:54 am

Post Posted April 12th, 2004, 5:10 pm

engmike8 wrote:http://www.engadget.com/rss.xml
http://blo.gs/3186/favorites.rss


Well, the only other things I have done are to fix spelling errors that have since been fixed in the official versions, and to play with the CSS file for the contents area. Nothing that would solve the problems with the two feeds you mentioned. I see those question marks too. The feeds validate OK, so it must be something RSS Reader is doing.

I don't know much about programming for Mozilla so I'm not sure where to begin, but I might take a look at it. If I find anything, of course I will let you know.

farmerchris
 
Posts: 31
Joined: June 16th, 2003, 11:54 am

Post Posted April 12th, 2004, 5:31 pm

Well here's what I've discovered. The update function compares the date that you last looked at an RSS feed with the date that the server says the file was last updated. The problem with those two feeds is, their server doesn't provide a Last-Modified header, so there is no way to tell whether they've been updated or not. Not really a bug in RSS Reader. Just a deficiency.

One of those sites is on an IIS 5 server. The other is Apache 1.3.26. So I don't know why they would be configured this way. Who knows. Maybe you could contact them and ask.

I imagine there could be an alternate way to detect site updates. The code could do a hash of the newest RSS entry's url and store that in the bookmark's description field. Then compare the hash when the update comes in. I really don't have time to think about how to do that right now, but it would make a good learning project. :)

mommajoan
 
Posts: 59
Joined: December 19th, 2003, 8:12 pm

Post Posted April 12th, 2004, 6:02 pm

farmerchris:

I've come accross another problem with the RSS Reader.

I've been trying it out in:

Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7b) Gecko/20040410 Firefox/0.8.0+

and it doesn't matter if you have the sidebar docked on the right or left, the article headers that show when you hold your mouse over them show up in the middle of the browser window.

This just started with the above version of Firefox.
It worked ok in:
Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.6) Gecko/20040206 Firefox/0.8

Just to check for conflicts, I did disable all of my other extensions first and this problem still happened. I uninstalled, reinstalled and tried with a new profile also with no luck.

Is there any way you might be able to look at this.
I don't know Japanese either and I certainly don't know anything about how extensions work.

Thanks!

farmerchris
 
Posts: 31
Joined: June 16th, 2003, 11:54 am

Post Posted April 13th, 2004, 11:02 am

mommajoan:

Sorry, I don't know what might cause that. I avoid non-milestone releases of the browser these days. I've noticed that the tooltips aren't always placed in the best location, especially on my second monitor.

Dont know how to help you, I'm afraid.

Return to Extension Development


Who is online

Users browsing this forum: No registered users and 1 guest