RSS feed creation - Discussion and Solution

Post your requests for addons here, and discuss any addons in development here, as well.
Once an addon has completed development, it will be released in the "Addon Release" forum.

Moderator: Spunkmeyer

Postby Dale Ray » Fri Feb 03, 2006 5:56 pm

faithless wrote:
Dale Ray wrote:... This isn't as easy in 1.24 because you can not set an extension for each profile and because of the missing date fields to create a date compliant with the standard....


Using a standard profile type in 1.24, you can change the file extension type generated by changing the value of the filename generated from news.txt to news.xml or any filename.ext you so desire.


When I wrote that you can not specify the file extension on a per profile basis, I meant for output that uses a template. If you wish to use a style only you can specify the entire filename for each profile.

The setting that you are talking about changes the extension for the file that is created by processing the items through a style only. To place what amounts to a header and footer into the file without using perl code or complicated if statements in the style to limit the printing of the header or footer to a single instance when there are multiples items in the file.

The easiest way for most users to create a static page for an RSS feed is to use a template. In Coranto V 1.24 and below you can not change the file extension for each profile.

You can build an RSS feed using a variety of methods, just as you can accomplish most things in Coranto in a variety of ways.
Dale Ray
User avatar
Dale Ray
 
Posts: 1001
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana

Re: Almost Joy!?

Postby Dale Ray » Fri Feb 03, 2006 6:05 pm

draines wrote:
Dale Ray wrote:Try this:

Oh, sure, show me how it is done by writing Perl!? :shock:

. . . quote edited for length :) . . .

Comments?


draines,

It looks like you are the one who wrote the most perl. Glad I got you going in a direction that works for you.

As I mentioned in my last post to faithless - there are a lot of ways to get things done in Coranto. Thanks for contributing your ideas and work here.

I am of the opinion that there is really no need for a specific RSS addon. I think that by using the techniques discussed in this thread most users can put together an RSS feed. By using the methods here you have the flexibility to build the feed to suit your needs.
Dale Ray
User avatar
Dale Ray
 
Posts: 1001
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana

Postby shanemckiness » Sat Feb 04, 2006 3:34 am

I understand. Nobody wants to do work for something they won't use anyway.
shanemckiness
 
Posts: 234
Joined: Fri May 21, 2004 5:14 pm

Re: Almost Joy!?

Postby DRaines » Sat Feb 04, 2006 7:21 am

Dale Ray wrote:I am of the opinion that there is really no need for a specific RSS addon. I think that by using the techniques discussed in this thread most users can put together an RSS feed. By using the methods here you have the flexibility to build the feed to suit your needs.

I would have to agree. I am very happy with the results I have been able to obtain so far. Thanks for kick-starting me.

Darrel
DRaines
 
Posts: 5
Joined: Thu Jan 11, 2007 11:44 pm
Location: Houston, TX, USA

Re: Almost Joy!?

Postby Parahead » Sun Feb 05, 2006 4:20 pm

draines wrote:I decided to dig deeper by browsing through the rest of the code. I noted that crlib.pl has the time functions set up in a subroutine. It was this code reading that made clear that the function $Abbrev_Month_Name was available. Another variable could be added (the code is almost all there already) to produce $Abbrev_Weekday. However, I don't want to change the baseline code.
Just wanted to give you feedback on this. The $Abbrev_Weekday is available in Coranto 1.31.x, I noticed the same thing as you did some time ago so it has been added for some time. The documentation about the time fields needs a little update though, as you have noticed there is some 'hidden' variables. ;-)

Very nice of you to post your findings and results as well, much appreciated. :-)
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Why Coranto?

Postby DRaines » Thu Feb 09, 2006 7:21 pm

I just wanted to thank everyone who posted to this topic. I am able to fully populate my RSS 2.0 file from within Coranto. Everything works great!

I also wanted to use this topic to say why I still use Coranto:

About 4 years ago I was looking for a content management system to allow super-users to put information on some web sites that I do for volunteer organizations. I didn't even know what CMS stood for at that time. After an extensive search, I decided Coranto had the best combination of ease-of-use and ability to integrate into an existing site. All went well.

Fast forward to this year. I had been thinking that Coranto was not giving me everything that I wanted. I was not able to put file links onto a news item easily. Coranto was not producing an RSS feed. I wanted to be able to handle news items in a MySQL file instead of a flat text file.

I looked at many different solutions. I even implemented a DragonFly sub-site on my personal web site. However, almost all CMS software expects to have full control of a web site. This is rarely possible for me. It is more trouble to modify the CMS output than it is to include parts of the CMS output in my overall web design. So after an exhaustive search, I came back to look at how to extend Coranto.

I found that I wasn't even using half of Coranto's capabilities. It was intuitive for me to create parts of a web page that are then included (SSI) in the final page. I just had to learn how to do the things I wasn't doing. Thanks to Multi-part (which I had already installed), FakeSQL, and learning more on how to modify my news profiles and styles, I am now able to produce exactly what I needed for my sites.

The moral to this story? Twofold:
1) Sometimes what you want is right in front of you.
2) Simple is better than overkill, especially if you can customize simple.

That is my story for what it is worth. :!:
Darrel
DRaines
 
Posts: 5
Joined: Thu Jan 11, 2007 11:44 pm
Location: Houston, TX, USA

Postby SrNupsen » Thu Feb 09, 2006 7:45 pm

May we use as a testimonial on the site? :D

SrNupsen
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby DRaines » Thu Feb 09, 2006 9:24 pm

SrNupsen wrote:May we use as a testimonial on the site?

I would be happy for you to do so. Please shoot me a link to the site area after you get it up (use the forum mail).

And everything I said was true! :D

Darrel
DRaines
 
Posts: 5
Joined: Thu Jan 11, 2007 11:44 pm
Location: Houston, TX, USA

Postby shanemckiness » Sun Feb 19, 2006 6:44 am

It works. yeah. But I have one problem. Using the above steps, I end up generating 2 files. The first (and extra) file is the regular profile files (called rss.txt). In this same profile in which the tempalte is applied, a second file is generated called rss.xml, which is the above file inside the template. I thought I could just delete the entry under "File Name", but coranto won't build....Do I have to just live with the file? Or is there some way so it wouldnt be produced.

-Shane
shanemckiness
 
Posts: 234
Joined: Fri May 21, 2004 5:14 pm

Postby Parahead » Sun Feb 19, 2006 10:47 am

shanemckiness wrote:Do I have to just live with the file?
Yes
Yes, I am still around...
www.parahead.com/coranto/
User avatar
Parahead
 
Posts: 4837
Joined: Fri Jan 12, 2007 8:54 pm
Location: Stockholm - Sweden

Postby SrNupsen » Sun Feb 19, 2006 8:29 pm

I have experienced the same thing - but I had forgot about the extra file until now. Oh well... It can stay, I guess.

SrNupsen
-----------------------------------------------------------------------------------------------------
Coranto is free software. I am available for custom work or troubleshooting.

http://www.sundaune.no - transkripsjon, webdesign, nettsider, tekstbyrå
http://www.vagbladet.no - satire, politikk, kultur, sport, nettavis
-----------------------------------------------------------------------------------------------------
SrNupsen
 
Posts: 2229
Joined: Tue Jan 09, 2007 6:46 pm
Location: Nesodden, outside Oslo, Norway

Postby shanemckiness » Mon Feb 20, 2006 5:52 am

I'm a little confused..
This is my Template
Code: Select all
<?xml version="1.0" ?>
<rss version="2.0">
<channel>
<title>EpicSFF</title>
<copyright>Copyright (c) 2006 EpicSFF. All rights reserved.</copyright>
<description>Epic Science Fiction and Fantasy Online Magazine.</description>
<link>http://www.epicsff.com</link>
<field: Content>
</channel>
</rss>

This is my style
Code: Select all
<PerlCode>
$pubDate = substr ($Weekday,0,3).", " . $TwoDigitDay . " " . substr ($Month_Name,0,3) ." " . $Year ." " . $TwoDigitHour . ":" . $Minute . ":" . $Second . " CST";
</PerlCode>
<PerlCode>
$CurrentMonth = (localtime(time))[4];
next unless ($CurrentMonth == $Month);
</PerlCode>
<item>
<title><Field: Subject></title>
<description><Field: CustomField_short></description>
<link>http://www.epicsff.com/articles/<Field: TwoDigitYear>/<Field: TwoDigitMonth>/<Field: CustomField_filename>/</link>
<guid isPermaLink="false">/<Field: TwoDigitYear>/<Field: TwoDigitMonth>/<Field: CustomField_filename>/</guid>
<pubDate><Field: pubDate></pubDate>
</item>

In my use, the pubDate is the date that the individual news items were published.  My question is how do I put a Last Build Date in the style?
I would like the Last Build Date to equal the date of the last item put into the rss feed (not the date of the last rebuild.

Thanks,
-Shane
shanemckiness
 
Posts: 234
Joined: Fri May 21, 2004 5:14 pm

Postby Dale Ray » Mon Feb 20, 2006 3:28 pm

Shane,

It is simply how Coranto works that when you build static pages with normal Coranto profiles you end up with the extra files.

This page shows how Coranto builds news.

When your style is processed a file is created that is intended to be used by including it in another page using SSI or php includes. Then your template is processed and another file is created that is an entire web page.

The file that is output after the style is processed usually end up being incomplete pages. Processing the template adds a header and footer that completes the structure of the page. This is because the style is processed once for each item and the template is processed once for the profile.

You can use perlcode and addons to eliminate the need for a template. For most user the minimal space that is used by the extra file is not an issue and using the style/template combination is a more straightforward solution.
Dale Ray
User avatar
Dale Ray
 
Posts: 1001
Joined: Sun Jan 19, 2003 6:02 pm
Location: NW Indiana

Postby shanemckiness » Mon Feb 20, 2006 4:02 pm

Apparently some of my text was removed from my previous post. The real question was How can I pust a lastbuilddate into the profile portion to make it so that lastbuilddate = the date that the last news item was published?

Thanks,
Shane
shanemckiness
 
Posts: 234
Joined: Fri May 21, 2004 5:14 pm

Postby Psykosys » Mon Feb 20, 2006 11:41 pm

shanemckiness wrote:Apparently some of my text was removed from my previous post. The real question was How can I pust a lastbuilddate into the profile portion to make it so that lastbuilddate = the date that the last news item was published?

Thanks,
Shane

You may be able to use a simple little bit of Perl, assuming that your profile is set to reverse-chronological order. At the top of your newsstyle, you could put:
Code: Select all
<PerlCode>
$lastdate;
if ($lastdate == null) {
$lastdate = $Date;
}
</PerlCode>

Then, in your template you could use <Field: lastdate> where you wanted the date to show.
Psykosys
 
Posts: 252
Joined: Tue Apr 15, 2003 10:37 pm
Location: Ithaca, NY

PreviousNext

Return to Addon Development and Requests

Who is online

Users browsing this forum: No registered users and 1 guest

cron