RSS2 content:encoded support?

2011-12-30
2012-08-29
  • RSSOwl supports content:encoded for a long time. Maybe something else goes
    wrong though.

     
  • genodeftest
    genodeftest
    2011-12-31

    Right, but this feed is not displayed correctly for me (RSSOwl on Linux
    x86_64). Maybe XULRunner 1.9.2 does not support contend:encoded ?

     
  • The browser shouldnt make a difference when it comes to parsing the feed, this
    is all the same. But maybe the browser is not displaying it properly.

     
  • Rocco Caputo
    Rocco Caputo
    2011-12-31

    I'm running RSSOwl on Mac OS X, so it seems to be a cross-platform issue. The
    feed link I provided should help you reproduce the problem.

    I'll try tracking it down from your github repository, but I make no promises.
    I'm not proficient in Java, and RSSOwl looks pretty big.

     
  • Rocco Caputo
    Rocco Caputo
    2011-12-31

    The development dependencies are daunting. I'm limiting myself to reading the
    source and blind, untested patches like the one below.

    RSSInterpeter.java doesn't mention "content" at all. Here's my naïve attempt
    to add support.

    diff --git
    a/org.rssowl.core/src/org/rssowl/core/internal/interpreter/RSSInterpreter.java
    b/org.rssowl.core/src/org/rssowl/core/internal/interpreter/RSSInterpreter.java

    index 360c67a..195c0f7 100644

    --- a/org.rssowl.core/src/org/rssowl/core/internal/interpreter/RSSInterpreter.java
    +++
    b/org.rssowl.core/src/org/rssowl/core/internal/interpreter/RSSInterpreter.java

    @@ -421,8 +421,15 @@ public class RSSInterpreter extends BasicInterpreter {

    processNamespaceAttributes(child, news);

    }

    • / Content /
    • else if ("content:encoded".equals(name)) { //$NON-NLS-1$
    • / TODO - Content is HTML-encoded. Decode it? /
    • news.setDescription(child.getText());
    • processNamespaceAttributes(child, news);
    • }
    • / Description /

    • else if ("description".equals(name)) { //$NON-NLS-1$

    • else if ("description".equals(name) && news.getDescription() == null) { //$NON-NLS-1$
      news.setDescription(child.getText());

    processNamespaceAttributes(child, news);

    }

    @@ -594,4 +601,4 @@ public class RSSInterpreter extends BasicInterpreter {

    }

    }

    }

    -}
    \ No newline at end of file

    +}

     
  • Well there is a class that handles the content namespace separately from the
    RSS interpreter. That way, it is accepted in every format, not just RSS.

     
  • Rocco Caputo
    Rocco Caputo
    2012-01-01

    Sorry, I was confused by the presence of explicit "content" handlers in the
    Atom and JSON interpreters. The lack of a "content" handler in the RSS
    interpreter seemed odd when everything else had it.

    Could the order of "content" and "summary" elements in feeds be significant?
    The test feed I linked to earlier in this thread has "content" before
    "description".

    It seems the Atom interpreter will call news.setDescription(...) for both
    "content" and "summary" elements, but it doesn't prevent "summary" from
    overwriting "content". I can't see where the RSS interpreter parses "content",
    it may have a similar issue.

    Here's a different patch that prevents RSS "description" and Atom "summary"
    from calling news.setDescription(...) if the description is already set...
    presumably by an earlier "content" element.

    diff --git a/org.rssowl.core/src/org/rssowl/core/internal/interpreter/AtomInte
    rpreter.java b/org.rssowl.core/src/org/rssowl/core/internal/interpreter/AtomIn
    terpreter.java

    index e674b89..0e1b560 100644

    --- a/org.rssowl.core/src/org/rssowl/core/internal/interpreter/AtomInterpreter.java
    +++ b/org.rssowl.core/src/org/rssowl/core/internal/interpreter/AtomInterpreter
    .java

    @@ -192,8 +192,14 @@ public class AtomInterpreter extends BasicInterpreter {

    processNamespaceAttributes(child, news);

    }

    • / Content / Summary /
    • else if ("content".equals(name) || "summary".equals(name)) { //$NON-NLS-1$ //$NON-NLS-2$
    • / Content (can overwrite summary) /
    • else if ("content".equals(name)) { //$NON-NLS-1$
    • news.setDescription(getContent(child));
    • processNamespaceAttributes(child, news);
    • }
    • / Summary (cannot overwrite content) /
    • else if ("summary".equals(name) && news.getDescription() == null) { //$NON-NLS-1$
      news.setDescription(getContent(child));

    processNamespaceAttributes(child, news);

    }

    @@ -418,4 +424,4 @@ public class AtomInterpreter extends BasicInterpreter {

    }

    }

    }

    -}
    \ No newline at end of file

    +}

    diff --git
    a/org.rssowl.core/src/org/rssowl/core/internal/interpreter/RSSInterpreter.java
    b/org.rssowl.core/src/org/rssowl/core/internal/interpreter/RSSInterpreter.java

    index 360c67a..47360ce 100644

    --- a/org.rssowl.core/src/org/rssowl/core/internal/interpreter/RSSInterpreter.java
    +++
    b/org.rssowl.core/src/org/rssowl/core/internal/interpreter/RSSInterpreter.java

    @@ -422,7 +422,7 @@ public class RSSInterpreter extends BasicInterpreter {

    }

    / Description /

    • else if ("description".equals(name)) { //$NON-NLS-1$
    • else if ("description".equals(name) && news.getDescription() == null) { //$NON-NLS-1$
      news.setDescription(child.getText());

    processNamespaceAttributes(child, news);

    }

    @@ -594,4 +594,4 @@ public class RSSInterpreter extends BasicInterpreter {

    }

    }

    }

    -}
    \ No newline at end of file

    +}

     
  • Rocco Caputo
    Rocco Caputo
    2012-02-06

    Hello again. I'm just following up to make sure my last patch hasn't been lost
    due to the brief forums outage last month.

     

  • Anonymous
    2012-05-19

    This may be related to an issue some people are having--me included.

    When you create a feed, it only adds the most recent article to the top of it,
    and then it never updates again. Although, RSSOwl does report the feed as
    being successfully updated.

    Here is a link to the other topic. https://sourceforge.net/projects/rssowl/fo
    rums/forum/296910/topic/5008700/index/page/1