RSS Tutorial v.05 Purpose: ***TODO*** Acknowledgements: I've never attempted to write a tutorial like this before, although my 9-5 is helpdesk work, it's sure a lot easier to talk people through things then it is to actually write the steps down. Thanks to Dana, Cheryl, and the others who've given this a shot and helped me find the faults in my original tutorial. Hopefully this one is much easier to follow. If you have any problems or suggestions for improving this document, please email me at dean@dean-o.org. If you end up using this tutorial and it's worked for you, please spread the love, either with a link back to my blog: http://deanmckenzie.org or with a link back to the tutorial http://deanmckenzie.org/howtofeed.txt Overview: 1. Download and install mt-list plugin 2. Download and install mt-rssfeed plugin 3. Create new index template 4. Test your new plugins 5. Configure for your use Step 1: Download and install mt-list plugin Download the file from http://www.mplode.com/tima/files/mt-plugins/ . At the time of this writing it is the first plugin on the page- v0.2. More than likely you'll want to download the .ZIP file. Once you've extracted the files, you need to upload the mt-list.pl file into your plugins directory where Movable Type is installed. If there's not one you may need to create it. For complete installation information check out the mt-list.html file included with the download. Step 2: Download and install mt-rssfeed plugin As far as I'm concerned, this is the most difficult part. Download the file from http://www.mplode.com/tima/files/mt-plugins/ . At the time of this writing it is the third plugin on the page- v1.02. . More than likely you'll want to download the .ZIP file. For the complete instructions view the mt-rssfeed.html file included with the download. Once you've extracted the files, open the mt-rssfeed.pl in WordPad or your text editor of choice, and change some variables. The first line you may need to change is this one. If you are using a mySQL server to store your entries then you need to change this. change it from # my $RSSFEED_DATA_DIR = "./db/"; to my $RSSFEED_DATA_DIR = "/full/path/to/db/folder" for the path it'd be something like /home/server/public_html/movabletype/db/ if you don't have a folder in the movabletype directory called 'db' create one. (editorial note: I know this is confusing. I'm not sure how to make it more clear) View the mt-rssfeed.html file for information regarding the other variables that can be set, more than likely the only one you'll need to change is the one above. Once you've changed the variables, save the file and then upload the mt-rssfeed.pl file into your plugins directory where Movable Type is installed. If there's not one you may need to create it. Also upload the LP.pm file into your MTdir/extlib/XML/RSS directory. If you don't have these directories you need to create them. Step 3: Create new index template Once you have the plugins installed, the only other thing you have to do is add the script into your template. I created a new blog to play with so as to not mess up my working ones, but there is no reason you need to do this. If you want you can also just create a new index template in your main blog. (perhaps I'll add instructions for that in a later version if it's needed). The next thing I did was copy the sample code from the mt-rssfeed.html: http://www.mplode.com/tima/xml/index.xml http://www.movabletype.org/index.xml <$MTRSSFeedTitle$>

Syndicated using mt-rssfeed

and placed that into the "blogcontent" section of the Main index template. If you'd like to change what feeds it processes at this poing you can just add the links to the blogs you want included, such as mine: http://deanmckenzie.org/index.xml You'd put that either in place of or after http://www.movabletype.org/index.xml. Step 4: Test your new plugins During the rebuild you might get some errors like the following: MT::App::CMS=HASH(0x17851a8) mt-rssfeed: mismatched tag at line 254, column 2, byte 6282 at C:/Perl/site/lib/XML/Parser.pm line 168 http://vees.net/index.xml at \htdocs\mt\plugins\mt-rssfeed.pl line 140. or MT::App::CMS=HASH(0x17851a8) mt-rssfeed: not well-formed at line 48, column 4059, byte 18750 at C:/Perl/site/lib/XML/Parser.pm line 168 http://www.visuallee.com/weblog/blogger_rss.xml at \htdocs\mt\plugins\mt-rssfeed.pl line 140. These errors are ok. What they're telling you is that one or more of the XML feeds you're trying to load has problems... in this case it's http://vees.net/index.xml and http://www.visuallee.com/weblog/blogger_rss.xml - the only way to fix them is to have the owner of the website fix their XML feed. If you get any other errors check the mt-rssfeed.html documentation or the movabletype.com support forums. At this point all you need to do is load your newly created index page and you should see the listings. Step 5: Configure for your use If you'd like for yours to look like mine, I don't care it's mostly the default MT template anyway, here's what you need to do: 1. Create a module named feeds: a.At the bottom of the template page there is a section that is called Template Modules. Click the link that says "Create a new template module". b.Under Template Name, type "feeds" without the quotation marks. c.Put the list of XML files in the module body section. One link per line, no spaces. This is part of what is in my feeds module contains: http://deanmckenzie.org/index.xml http://amymckenzie.com/index.xml 2. Copy my style sheet from http://deanmckenzie.org/mt-devel/styles-site.css and put it in your Style Sheet template This is mostly the default style-sheet for the Georgia Blue template from Movable Type. I've made some small changes in order to get the font sizes looking nice. 3. Put the following into your feeds index template at the same place as the other section: <$MTInclude module="feeds"$> <$MTRSSFeedTitle$> Syndicated using mt-rssfeed *************THIS IS THE END OF THE OFFICIAL TUTORIAL**************** What follows are notes that I want to include but am not sure how to incorporate them, or don't have time to edit them. There is also a section on what I did to correct a problem with the cron job, but haven't discussed the cron job at all at this point. If you have any suggestions on how to improve the tutorial, or how to incorporate the following notes, please let me know. dean@dean-o.org *********************************************************************** A breakdown of what's happening, as best as I understand it! 1. Instead of including the list of xml files that I want to display, I created a MT Module called feeds. The only thing that is in it is the list of xml files that I want to display. No formatting, no spaces. Each link on it's own line. basically: http://deanmckenzie.org/index.xml http://amymckenzie.com/index.xml What that does is allow you to add feeds without editing your template. It's called with the <$MTInclude module="feeds"$> tag. 2. I wanted the name of the feed to link back to the main page that is generating the feed. So I changed the template a bit- If you look at my xml file http://deanmckenzie.org/index.xml : deanmckenzie.org http://deanmckenzie.org/ en-us RSS and stuff Working with RSS has been a lot of fun, and let's me put to use some of the XML knowledge... http://deanmckenzie.org/archives/004358.php That line takes the Feed Title: deanmckenzie.org and creates a link to the Feed Link: which is the contents between and for the channel element: http://deanmckenzie.org so that line that reads <$MTRSSFeedTitle$> would end up looking like deanmckenzie.org 3. The next thing I do as it starts to creat the links is add the excerpt or the Item Description to the loop. So instead of having just a link to the post, it actually has the first 20 words (by default) of the post. To read the whole thing you have to click the link and be taken to the actual post. Hopefully that's not too confusing. More problems?! Cron Job: The ./db file it's referencing is in your mt.cfg file. So basically what I needed to do was change the line that says DataSource Directory from ./db to an absolute path. So from ./db to /home/test/public_html/movabletype/db I also had to change the Data Source directory in the mt-rssfeed.pl file to an absolute path. Once I did that I was able to then run the mt-rebuild-index.pl from the command line from my home directory. The next hurdle to jump was getting the cron job to run properly. Since this is a web-based cron job all I had was boxes to put the time in and a line for the command. Everytime I'd put the command in ./public_html/movabletype/mt-rebuild-index.pl -blog_id -template="our template" the job would show up without everything after the first quotation mark. My solution: I created a file in the home directory simply called 'rebuild' in it I put the command that I wanted to run: ./public_html/movabletype/mt-rebuild-index.pl -blog_id -template="our template" and then for the cron command I set it to ./rebuild - so it ran the file rebuild on schedule. And that's how I fixed this cron issue! Hope this can help others.