
Benjamin
Staff

Apr 24, 2003, 8:50 PM
Post #1 of 80
(35332 views)
Shortcut
|
|
RSS Syndicated Content with Article Manager. First Step.
|
Can't Post
|
|
Hi all, I’ve spent some time swotting up on RSS and thought I’d open it up to the forum in the hope of stimulating some discussion. We really need to sound out people’s precise needs to figure out how and where we need to improve Article Manager to accommodate it. After batting ideas around with some co-workers, we eventually decided that passing in a unique RSS-friendly template to the search engine would be the way to go – or at least a sensible preliminary approach. So, I’ve written a (basic) RSS-friendly template which I’ve attached to this post. Like always, you use it with your search engine as follows: …search.cgi?search=1&template=syndicate.rss (Place the file directly in your /templates directory). And feel free to add whatever specific search criteria you wish to trim down your search. [the only relevant restriction is that with the RSS 0.91 Standard, you’re limited to only 15 syndicated articles. It’s not a hardcoded restriction, but be warned: going over that number will invalidate your RSS feed… (sounds ominous, doesn’t it? ;-)] The following is a few details about implementing it on your site and the assorted problems / limitations / questions you might run into. 1. Version Of the various standards of RSS out there I vouched for the oldest for the attached template. According to the RSS O’Reilly text, 55% of webfeeds are using 0.91 (March 2003), so I gotta go with the majority… (at least for starters). Plus 0.91 is forward compatible. But, of course, go right ahead and redo the template for 0.92 or 2.0. Mind you, at this stage, the version is of considerable less importance than the actual manner of syndication. But let me just make a couple of remarks to first help you getting it going on your sites: Dates To conform to RSS standards, all date fields (notably the <pubDate> element, used to output the last updated field), have to be in a format defined in RFC 822 (http://www.faqs.org/rfcs/rfc822.html). As an example: Mon, 21 Oct 2002 14:04:23 EDT By default, Article Manager’s date_time is set to this format: Apr 24th, 2003 - 15:53:17 Close, but no cigar. This formatting won’t validate properly. To fix this, you'll need to edit your config.ini file (in /exec directory). Change this line: datetime_format = %b %o, %Y - %H:%M:%S to this: datetime_format = %a, %d %b %Y %H:%M:%S (Alternatively, you could just remove the <pubDate> element from your template). Now the $global_updated$ placeholder will work it’s magic in your template. 2. The syndicate.rss template The attached template is very basic; there’s virtually no difference between each of the four template cells – I found 0.91 quite fastidious in it’s formatting requirements – and it raised questions about how one could even emulate the current Article Manager syndication (I’ll discuss that below). To get this properly running on your site, you’ll need to update a couple of places in the syndicate.rss template: <description>Name of feed</description> - here, you can name your particular webfeed (perhaps your website name) <pubDate>$global_updated$ PST</pubDate> - As mentioned, either remove this line or change your date_time format. <image> <url>http://www.yoursite.com/path/to/image.gif</url> <title>Description of image here</title> <link>$url_publish$</link> </image> The image element, surprisingly enough (to me) is required. It’s supposed to describe the feed’s accompanying icon. Funny that there’s no <image> option allowed for the ARTICLE, but only for the feed itself... 2. Browser When you’ve fixed up the template for your site’s specifications, then plunk it in your /templates directory and get the search.cgi to produce your new RSS feed (see above). Trying to load the page in IE yields an interesting problem - it refuses to even draw the page, so you won’t be able to capture the feed. The latest versions of Mozilla and Netscape work fine. It seems to be an issue with the way IE handles MIME content-type in conjunction with cgi scripts plus the .rss template… but I’m really not sure where the problem lies just yet. But the million dollar question is: does the way you currently capture RSS feeds work with this approach to syndication? Can you grab the file for processing? One other note: since this approach uses your search engine to actively generate the webfeed, you won’t want to announce the location of the RSS feed on your site; having hundreds of sites continually querying your search engine just might be a strain on your server resources… ;-) Some useful links: RSS Feed Validator: http://feeds.archive.org/validator/ RSS 0.91 Standard: http://backend.userland.com/rss091 This has been my first taste of RSS (and I love it!) and I’d welcome any comments, suggestions, improvements or questions you might have. Let me end with some of my own: 1. Which version of RSS are you using? 2. How are you capturing the RSS file? (and how’s it being processed? – just curious :-) 3. Is the above approach compatible with the way which you currently capture RSS files? 4. Do you think the RSS standard will really work to properly syndicate Article Manager content? The reason I ask this is because of the following: - There’s no permissible <image> subelement in <item>, so you can't syndicate article images. - How could we differentiate between ‘types’ of article – (URL link only, summary only, full article, file) ? - There's no HTML allowed in syndicated fields… (again, for strict compliance). This hardly goes hand-in-hand with the ol' built-in WYSIWYG field. If you have multiple authors entering articles, how would you prevent them entering in HTML - even with the WYSIWYG field disabled? (Ask them really nicely...?!) - How can we offer the same variety in syndication options like we do with the current JavaScript syndicator with an RSS version? The above method is ultimately unrealistic for syndication on large numbers of sites in that repeated queries to the search.cgi script would overload the server. So how can we do it better? Anyway, I hope the above will provoke some thought and comments.
Ben interactivetools.com
(This post was edited by Benjamin on May 4, 2003, 1:44 PM)
|