Help - Search - Members - Calendar
Full Version: Global RSS Feed?
Movable Type Community Forum > Additional Resources > Tips and Tricks
srdownie
How do I go about configuring MTGlobalListings to combine all of my individual RSS feeds into one big RSS lump? I have ten small MT blogs that I'd like for users to see as one integrated whole.

Any and all advice will be appreciated.

Thanks!

Scott
LisaJill
This is my global RSS feed. It combines the output from 3 blogs - with different methods of display.

The plugins used for this are MTGlobalEntries and MTcompare

CODE
<?xml version="1.0" encoding="iso-8859-1"?>
<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><$MTBlogName remove_html="1" encode_xml="1"$></title>
<link><$MTBlogURL$></link>
<description><$MTBlogDescription remove_html="1" encode_xml="1"$></description>
<dc:language>en-us</dc:language>
<dc:creator><MTEntries lastn="1"><$MTEntryAuthorEmail$></MTEntries></dc:creator>
<dc:rights>Copyright <$MTDate format="%Y"></dc:rights>
<dc:date><MTEntries lastn="1"><$MTEntryDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></MTEntries></dc:date>
<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=<$MTVersion$>" />
<admin:errorReportsTo rdf:resource="mailto:<MTEntries lastn="1"><$MTEntryAuthorEmail$></MTEntries>"/>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
<MTGlobalEntries include_blogs="1,9,8" lastn="15">
<MTIfEqual a="[MTBlogID]" b="1" numeric="1">
<item>
<title><$MTEntryTitle remove_html="1" encode_xml="1"$></title>
<link><$MTEntryLink encode_xml="1"$></link>
<guid isPermaLink="false"><$MTEntryID$>@<$MTBlogURL$></guid>
<content:encoded><![CDATA[<$MTEntryBody$>]]></content:encoded>
<dc:subject><$MTEntryCategory remove_html="1" encode_xml="1"$></dc:subject>
<dc:date><$MTEntryDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></dc:date>
</item>
</MTIfEqual>
<MTIfEqual a="[MTBlogID]" b="9" numeric="1">
<item>
<title><$MTEntryTitle remove_html="1" encode_xml="1"$></title>
<link><$MTEntryLink encode_xml="1"$></link>
<guid isPermaLink="false"><$MTEntryID$>@<$MTBlogURL$></guid>
<content:encoded><![CDATA[<$MTEntryBody$>]]></content:encoded>
<dc:subject><$MTEntryCategory remove_html="1" encode_xml="1"$></dc:subject>
<dc:date><$MTEntryDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></dc:date>
</item>
</MTIfEqual>
<MTIfEqual a="[MTBlogID]" b="8" numeric="1">
<item>
<title><$MTEntryTitle remove_html="1" encode_xml="1"$></title>
<link><$MTEntryLink encode_xml="1"$></link>
<guid isPermaLink="false"><$MTEntryID$>@<$MTBlogURL$></guid>
<content:encoded><![CDATA[<img src="<$MTEntryBody$>.jpg" />]]></content:encoded>
<dc:subject><$MTEntryCategory remove_html="1" encode_xml="1"$></dc:subject>
<dc:date><$MTEntryDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></dc:date>
</item>
</MTIfEqual>
</MTGlobalEntries>
</channel>
</rss>


Unlike the default index.xml, this is a -full text- output. I hate just excerpts, so I made it full text.

Now this can easily be modified for any sitewide blog. If you do not have diffrent display methods then you can use this template, which is the same but I modified for a system where all the output is the same.

CODE
<?xml version="1.0" encoding="iso-8859-1"?>
<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><$MTBlogName remove_html="1" encode_xml="1"$></title>
<link><$MTBlogURL$></link>
<description><$MTBlogDescription remove_html="1" encode_xml="1"$></description>
<dc:language>en-us</dc:language>
<dc:creator><MTEntries lastn="1"><$MTEntryAuthorEmail$></MTEntries></dc:creator>
<dc:rights>Copyright <$MTDate format="%Y"></dc:rights>
<dc:date><MTEntries lastn="1"><$MTEntryDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></MTEntries></dc:date>
<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=<$MTVersion$>" />
<admin:errorReportsTo rdf:resource="mailto:<MTEntries lastn="1"><$MTEntryAuthorEmail$></MTEntries>"/>
<sy:updatePeriod>hourly</sy:updatePeriod>
<sy:updateFrequency>1</sy:updateFrequency>
<sy:updateBase>2000-01-01T12:00+00:00</sy:updateBase>
<MTGlobalEntries include_blogs="1,9,8" lastn="15">
<item>
<title><$MTEntryTitle remove_html="1" encode_xml="1"$></title>
<link><$MTEntryLink encode_xml="1"$></link>
<guid isPermaLink="false"><$MTEntryID$>@<$MTBlogURL$></guid>
<content:encoded><![CDATA[<$MTEntryBody$>]]></content:encoded>
<dc:subject><$MTEntryCategory remove_html="1" encode_xml="1"$></dc:subject>
<dc:date><$MTEntryDate format="%Y-%m-%dT%H:%M:%S"$><$MTBlogTimezone$></dc:date>
</item>

</MTGlobalEntries>
</channel>
</rss>


For the one above you would simply need to change the blogid's in the MTGlobalEntries tag =)

Let me know if you need any assistance with this.
srdownie
I had uniform templates across my blogs so I used your second (generic) technique. It works perfectly!

Thanks!

Scott
LisaJill
Glad to hear it, especially the bolded perfectly biggrin.gif

My pleasure!
vacuity
hi lisa,
do you also know how it works for RDF-files? I successfully edited my XML-file the way you explained. Thank you!
But I don't get to run it with my RDF-file, and I usually use my RDF.


CODE
<?xml version="1.0" encoding="<$MTPublishCharset$>"?>

<rdf:RDF
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 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:cc="http://web.resource.org/cc/"
 xmlns="http://purl.org/rss/1.0/">

<channel rdf:about="<$MTBlogURL$>">
<title><$MTBlogName encode_xml="1"$></title>
<link><$MTBlogURL$></link>
<description><$MTBlogDescription encode_xml="1"$></description>
<dc:language>en-us</dc:language>
<dc:creator></dc:creator>
<dc:date><MTEntries lastn="1"><$MTEntryDate format="%Y-%m-%dT%H:%M:%S"

language="en"$><$MTBlogTimezone$></MTEntries></dc:date>
<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=<$MTVersion$>" />
<MTBlogIfCCLicense>
<cc:license rdf:resource="<$MTBlogCCLicenseURL$>" />
</MTBlogIfCCLicense>

<items>
<rdf:Seq><MTEntries lastn="15">
<rdf:li rdf:resource="<$MTEntryPermalink encode_xml="1"$>" />
</MTEntries></rdf:Seq>
</items>

</channel>

<MTEntries lastn="15">
<item rdf:about="<$MTEntryPermalink encode_xml="1"$>">
<title><$MTEntryTitle encode_xml="1"$></title>
<link><$MTEntryPermalink encode_xml="1"$></link>
<description><$MTEntryExcerpt encode_xml="1"$></description>
<dc:subject><$MTEntryCategory encode_xml="1"$></dc:subject>
<dc:creator><$MTEntryAuthor encode_xml="1"$></dc:creator>
<dc:date><$MTEntryDate format="%Y-%m-%dT%H:%M:%S"

language="en"$><$MTBlogTimezone$></dc:date>
</item>
</MTEntries>

</rdf:RDF>
LisaJill
If you were using the second option, you should be easily able to replace the MTEntries tags with the MTGlobalEntries tags that you used for the XML file.

That's really the only change.

If you need more explicit instructions, let me know. I don't use RDF because its outdated and dumpy, plus its one more file to update so I killed it, all modern news readers, tmk, will read xml. I still write to the template but its not linked - only someone that was really intent on .rdf could find it. =)

-Lisa
vacuity
I just tried to replace the tags. I thought it was that easy, too. But it gave me an error message. sad.gif

It said something with the prefix "content" wasn't right. Unfortunately I can't tell you the exact message, because I'm on a German system and get the message in German.
LisaJill
No idea then, I'll try to replace mine and see what happens, give me a minute.
LisaJill
I got no errors, I did however have to replace it in two places:

I have no idea about rdf btw, so no idea why it has 2x MTEntries... =)

Here's my template

CODE
<?xml version="1.0" encoding="<$MTPublishCharset$>"?>

<rdf:RDF
 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
 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:cc="http://web.resource.org/cc/"
 xmlns="http://purl.org/rss/1.0/">

<channel rdf:about="<$MTBlogURL$>">
<title><$MTBlogName encode_xml="1"$></title>
<link><$MTBlogURL$></link>
<description><$MTBlogDescription encode_xml="1"$></description>
<dc:language>en-us</dc:language>
<dc:creator></dc:creator>
<dc:date><MTGlobalEntries include_blogs="1,9,8" lastn="15"><$MTEntryDate format="%Y-%m-%dT%H:%M:%S" language="en"$><$MTBlogTimezone$></MTGlobalEntries></dc:date>
<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=<$MTVersion$>" />
<MTBlogIfCCLicense>
<cc:license rdf:resource="<$MTBlogCCLicenseURL$>" />
</MTBlogIfCCLicense>

<items>
<rdf:Seq><MTEntries lastn="15">
<rdf:li rdf:resource="<$MTEntryPermalink encode_xml="1"$>" />
</MTEntries></rdf:Seq>
</items>

</channel>

<MTGlobalEntries include_blogs="1,9,8" lastn="15">
<item rdf:about="<$MTEntryPermalink encode_xml="1"$>">
<title><$MTEntryTitle encode_xml="1"$></title>
<link><$MTEntryPermalink encode_xml="1"$></link>
<description><$MTEntryExcerpt encode_xml="1"$></description>
<dc:subject><$MTEntryCategory encode_xml="1"$></dc:subject>
<dc:creator><$MTEntryAuthor encode_xml="1"$></dc:creator>
<dc:date><$MTEntryDate format="%Y-%m-%dT%H:%M:%S" language="en"$><$MTBlogTimezone$></dc:date>
</item>
</MTGlobalEntries>

</rdf:RDF>


which is really the default but replaced 2x MTEntries opening and closing tags with MTGlobalEntries opening and closing tags....
vacuity
thank you very very much, lisa. i must have made some mistake before. but with your template it finally works for me. biggrin.gif

i saw quite a bunch of people still use RDF, but i guess i'll switch to XML mainly now, too.
LisaJill
I still have it I just don't link to it and don't really pay any attention to it. I subscribe to my own xml feeds tho... =)

glad it worked!
arbtree
How do you actually display an rss feed? Does the code above get copied and pasted into the index.html file or does it go in the index.xml file? If the latter, how do you actually display the feed on either an html page or one of my blog pages? Is there some sort of link that needs to be created to an xml file? Thanks.
LisaJill
RSS feeds are not intended to be displayed in a plain html page. They should be saved as some sort of .xml

if you want to replace index.xml that's fine, or you can create a new index template for this one, it's totally up to you

then you go to the URL for the feed (ie: http://www.yoursite.com/index.xml) and copy and paste it into a news reader (I use www.bloglines.com, there are several that can run locally etc, ie: feeddemon and newsgator, and sharpreader) and that interprets it.

you should adverrtise it's existance, so people can use it. you can do that by simply creating a text link like " syndicate this site" to the proper page, or using a graphic or any of the normal ways links are made. =) the white on orange xml button is a very common way to do this (can see that on my site in the right column, a bit down, that's made via CSS not an image).

Hope that helps!
psexi
Hey everyone! First time post, and brand new MTer. I was glad to find this thread because it addressed exactly what I was trying to do, and saved me a lot of gray hair.

I went to validate my RSS feed with the tool located at http://feeds.archive.org/validator/

The result:
My RSS is not valid because

"line 16, column 9: dc:date must be an W3CDTF date"


apparently my date tag is coming out empty or possibly in an invalid format. Anyone have an idea why that would be happening? I pasted the code verbatim.

psexi
LisaJill
Theres 4 or 5 templates above, can you tell us which you pasted? =) My index.xml validates (a miracle, i tell you) but I don't run the rdf to validate it...
psexi
It was the second template pasted in this thread.

Thanks for the quick response! smile.gif

psexi
LisaJill
I'm not really sure why this wouldn't validate, it does for me... do you have a link to it and your site?
LisaJill
Fixed this over instant message. There were two errors - one with a missing email, as one author had not entered their email, and one where the dc date is somewhat .. well, not working! It worked in my weblog cut and paste. But it's validated by removing the dc:date line before the beginning MTGlobalEntries tag and seems to have no ill effects on the rss feed.

Just in case anyone else happens upon this. =)
YP Geek
I can't get either RSS template to work. They both give me an error:

QUOTE
CODE
Build error in template 'RSS 2.0 Index': Error in <MTEntryTitle> tag: You used an 'MTEntryTitle' tag outside of the context of an entry; perhaps you mistakenly placed it outside of an 'MTEntries' container?


Any ideas?!
LisaJill
Can you paste the code that you're using here, and supply a link to the feed? Did you cut and paste an exact template, and which one from above? Did you paste it into an index template (CORRECT) or an archive template (INCORRECT)?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.