Problems with RSS2.0 feed not updating
Posted: 14 November 2006 01:19 PM   [ Ignore ]  
Summer Student
Total Posts:  21
Joined  03-04-2006

I seem to be having terrible trouble with my RSS 2.0 feed. When people can get it to work at all (Google Reader won’t subscribe to it, for example), it isn’t updating with the latest content and shows at the latest, a post on 7th Nov. I’ve tried flushing the cache, both including and not including ‘dynamic_start="on”’ and so on. The Atom feed, however, appears to work and update.

To make matters more confusing, I’m using embeds to direct to different feeds in the hope that feeds won’t break for people subscribed to the old url. So in template group ‘blog’, I have a template ‘feed’ like this:

{if segment_3 == "rss2" or segment_3 == ""}
  {embed
="blog/rss2"}
{
/if}
{if segment_3
== "atom"}
  {embed
="blog/atom"}
{
/if}

Then the actual feeds are in templates ‘rss2’ and ‘atom’ respectively. I’ve modified this temporarily to point everything towards the atom feeds. My RSS feed template is below. Can anyone spot anything stupid I’ve done that’s broken it?

{assign_variable:master_weblog_name="blog"}
{exp
:rss:feed weblog="{master_weblog_name}"}

<?xml version
="1.0" encoding="{encoding}"?>
<rss version="2.0"
    
xmlns:dc="http://purl.org/dc/elements/1.1/"
    
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
    
xmlns:admin="http://webns.net/mvcb/"
    
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    
xmlns:content="http://purl.org/rss/1.0/modules/content/">

    <
channel>
    
    <
title>{exp:xml_encode}{weblog_name}{/exp:xml_encode}</title>
    <
link>{weblog_url}</link>
    <
description>{weblog_description}</description>
    <
dc:language>{weblog_language}</dc:language>
    <
dc:creator>{email}</dc:creator>
    <
dc:rights>Copyright {gmt_date format="%Y"}</dc:rights>
    <
dc:date>{gmt_date format="%Y-%m-&#xdT;%H:%i:%s%Q"}</dc:date>
    <
admin:generatorAgent rdf:resource="http://www.pmachine.com/" />
    
{exp:weblog:entries weblog="{master_weblog_name}" limit="10" rdf="off" disable="member_data|trackbacks"}
    
<item>
      <
title>{exp:xml_encode}{title}{/exp:xml_encode}</title>
      <
link>{url_title_path="blog/archives"}</link>
      <
guid>{title_permalink=blog/index}#When:{gmt_entry_date format="%H:%i:&#xsZ;"}</guid>
      
<description>{exp:xml_encode}{exp:markdown}{body} {if extended != ""}<p>(Read more...)</p>{/if}{/exp:markdown}{/exp:xml_encode}</description>
      <
dc:subject>{exp:xml_encode}{categories backspace="1"}{category_name}, {/categories}{/exp:xml_encode}</dc:subject>
      <
dc:date>{gmt_entry_date format="%Y-%m-&#xdT;%H:%i:%s%Q"}</dc:date>
    </
item>
{/exp:weblog:entries}
    
    
</channel>
</
rss>

{/exp:rss:feed}

Profile
 
 
Posted: 14 November 2006 05:26 PM   [ Ignore ]   [ # 1 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5817
Joined  11-23-2003

Whenever I have problems I try the sample from the docs.  In this case you would look here.  If the sample works then you at least know RSS is working in general.  I will test your snippet on my own system and get back to you.

 Signature 

EE 2.0:  A designers dream becomes a developers dream | Follow me on Twitter.

Profile
 
 
Posted: 15 November 2006 01:21 AM   [ Ignore ]   [ # 2 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5817
Joined  11-23-2003

Can you provide a link to your site?  If you don’t want to make it public then you can send a link to me via private message.  I tried to use the snippet you posted and I was getting XML parsing errors.  Are you getting errors when you visit your RSS template directly?

 Signature 

EE 2.0:  A designers dream becomes a developers dream | Follow me on Twitter.

Profile
 
 
Posted: 15 November 2006 05:46 AM   [ Ignore ]   [ # 3 ]  
Summer Student
Total Posts:  21
Joined  03-04-2006

John: My site is but she’s a girl.

I’ve just tried replacing the template code for the rss2 feed with the example on the page you linked to. I just changed the master_weblog_name, and that feed updates fine, though because I use Markdown, it’s unformatted. When I tried to add the markdown formatting tags to wrap the body tag, it didn’t seem to work, though that works fine in the Atom feed. Anyway, it only works when you access the feed directly (i.e. http://www.rousette.org.uk/blog/rss2, not http://www.rousette.org.uk/blog/feed/rss2), whereas the Atom feed works fine when accessed through the feed template.

In Safari, if I load the http://www.rousette.org.uk/blog/feed/rss2 URL, I get and error.

Profile
 
 
Posted: 15 November 2006 10:06 AM   [ Ignore ]   [ # 4 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  21199
Joined  05-20-2002

There is weirdness here- Your logic and syntax seem sound, though I thought of a couple of possible issues (including needing a dynamic="off" paramter, but after running some simple tests on my site… There is weirdness.

I ended up trying:

<?php $seg = '{segment_3}';
if (
$seg == '' OR $seg=='rss') { ?>
  {embed
="site/rss_2.0"}
<?php }
else { ?>
  {embed
="site/atom"}
<?php } ?>

http://media-cow.com/site/test2/rss/ works, http://media-cow.com/site/test2/rss results in nothing, and atom gets mangled and sends an html header.  Granted the main test2 template is set to ‘weblog’ type- but the rss feed comes through ok.  And php is parsed on input, so…

I may actually give the dev crew a yell about this one.  It just seems odd- I’m missing something.

(Oh- and btw- cool article on transfering from wp- I linked to it!)

 Signature 

AKA rob1

Help Request Tips * Pro Network

Profile
 
 
Posted: 15 November 2006 10:43 AM   [ Ignore ]   [ # 5 ]  
Summer Student
Total Posts:  21
Joined  03-04-2006

I’m glad it’s not just me! Any thoughts you or the dev team have on how to fix it would be very welcome. If I can’t redirect the old URLs this way, I guess that I’ll either set up an .htaccess redirect, or if all else fails, set a static 1 item feed template to ask people if they could change to the new URL. But I’d rather redirect if possible.

Robin Sowell - 15 November 2006 10:06 AM

http://media-cow.com/site/test2/rss/ works, http://media-cow.com/site/test2/rss results in nothing, and atom gets mangled and sends an html header.  Granted the main test2 template is set to ‘weblog’ type- but the rss feed comes through ok.

That’s interesting. I set my ‘feed’ template to RSS and got the opposite pattern (atom works, rss fails).

Thanks for the help.

Profile
 
 
Posted: 15 November 2006 11:31 AM   [ Ignore ]   [ # 6 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  21199
Joined  05-20-2002

Ok- I did give the dev crew a heads up, but I played with it some more and I think this works.  Make sure the feed template is type rss- then we’ll put the full contents of both the atom and rss2 templates in there- instead of the embeds.  I tried it, looks like it works.  Here’s what mine looked like:

{assign_variable:master_weblog_name="blog"}
{if segment_3
== "atom"}
{exp
:rss:feed weblog="{master_weblog_name}"}

the whole atom tag bits
.....

</
feed>
{/exp:rss:feed}
{if
:else}

{exp
:rss:feed weblog="{weblog"}

the whole rss tag

</rss>

{/exp:rss:feed}
{
/if}

Seems to work fine in a quick test.  I’d actually think the weblog tags would need the dynamic="off" parameter, but in a quick test, that did not seem to be the case.

Anyway- worth a try.

 Signature 

AKA rob1

Help Request Tips * Pro Network

Profile
 
 
Posted: 15 November 2006 12:33 PM   [ Ignore ]   [ # 7 ]  
Summer Student
Total Posts:  21
Joined  03-04-2006

Yay! I think that’s working! Thanks so much for the fix.

Profile
 
 
Posted: 15 November 2006 02:07 PM   [ Ignore ]   [ # 8 ]  
Summer Student
Total Posts:  21
Joined  03-04-2006

Humph. Well it seems I typed too soon. I checked both feeds in both Safari and NNW, and both looked fine. Then I posted a new article, and the atom feed updated with the new item, and the RSS feed didn’t.

So I removed the markdown tags in the RSS feed to simplify it, and it seems to at least work again, though it looks ugly with raw markdown. So, another question, I’m afraid: what’s the best way to render markdown code in an RSS feed? I tried the CDATA tags, but that didn’t seem to work too well, though it works fine in the Atom feed.

Thanks again.

Profile
 
 
Posted: 15 November 2006 07:12 PM   [ Ignore ]   [ # 9 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  5817
Joined  11-23-2003

Take a look at this thread as well as the thread that I link to in the last post in that link.  See if the info in there leads to an answer to your questions.  If it does not then post back.

 Signature 

EE 2.0:  A designers dream becomes a developers dream | Follow me on Twitter.

Profile
 
 
Posted: 16 November 2006 05:56 AM   [ Ignore ]   [ # 10 ]  
Summer Student
Total Posts:  21
Joined  03-04-2006

I should have thought to use the same format as the Atom feed! Again, fingers crossed, I think that works.

Thanks for all the help.

Profile
 
 
Posted: 16 November 2006 09:26 AM   [ Ignore ]   [ # 11 ]  
Moderator
Avatar
RankRankRankRankRankRankRank
Total Posts:  21199
Joined  05-20-2002

Glad it’s squared away.  Derek did chime in- suggested if problems continued with the conditionals, just use htaccess redirects to make sure the old links don’t break.

 Signature 

AKA rob1

Help Request Tips * Pro Network

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 60973 Total Logged-in Users: 15
Total Topics: 73689 Total Anonymous Users: 11
Total Replies: 397491 Total Guests: 474
Total Posts: 471180    
Members ( View Memberlist )