|
Post by petefinnigan on Apr 2, 2007 2:31:51 GMT -5
Hi,
Thanks for your post on this issue amd sorry for the delayed response. We are now in the last few days before our baby is due, so my time spent in front of a computer for leisure is limited at the moment..:-).
I was aware of this issue already as I am currently re-writing the feed generation code so that it is built into GM rather than being a separate script. The issue is also there for the Atom0.3 feed. The problem is not so simple to fix without using CPAN modules top convert dates which i dont want to do (this makes the install break for some people). The entry dates in gm-entrylist.cgi are not stored in a time format i.e. from a C tm struct. they have lost information so to convert back for use in a feed is not simple. The feeds also require specific RFC date formats.
I think to make feeds simpler it would be better to store the datetime as a time format in gm-entrylist.cgi (Coldstone: do you think we can do this?) otherwise we will need to convert the date and time back to include the relevant fields. This means needing to calc what day of the week we are (i.e. Mon, Tue, Wed etc), day of the year etc. This means we need to work out leap years ect from the epoch. Also the time stored in gm-entrylist.cgi has lost the seconds.
I will have a proper look as soon as I can but i think the way forwrad may be to store the dates in gm-entrylist.cgi in C tm struct format.
cheers
Pete
|
|
|
Post by coldstone on Apr 3, 2007 15:33:10 GMT -5
That would be a largish change, because almost everything looks at those date fields.
However, there is good news. The Gm_Utils::getStdDate (get standard date) will tell you what day of the week it is, etc. It accounts for leap years, etc. Until everything is using the Gm_Storage mechanisms it will be very hard to change the underlying date format.
Also, the API doc in Gm_Storage shows that the seconds are stored for each entry. Basically, it sounds like you may want to work off the entry instead of entrylist?
Otherwise, it might be easier to add a new field to the entrylist, rssdate or something more generic, that is more of a standard date. I think adding will cause less issues then modifying existing. I can understand wanting to avoid the overhead of opening each entry, and using the convenient entrylist.
What would a standard date format be? Or rather, what format is the C tm struct format?
|
|
|
Post by saltor on Apr 20, 2007 20:36:24 GMT -5
Can someone point me to gm-library.cgi file with the rss statement inserted all in the correct sub routine places? I'd appreciate it.
|
|
|
Post by Carlos Phelps on Apr 21, 2007 0:12:35 GMT -5
|
|
|
Post by petefinnigan on May 3, 2007 10:20:37 GMT -5
Hi Coldstone, I am back!. Not sure how much time I can commit to GM at present but i am back trying to get all the RSS mod back into my head. I just revisted this issue and unfortunatly your suggestion wont work because the Gm_Utils::getStdDate function gets a new date for us when adding content. I need to read in an existing date and to be able to create the date for pubdate in the feed in an RFC822 format - asg.web.cmu.edu/rfc/rfc822.html - I need to be able to get back to the day of the week, i.e. from an entry such as 1|Pete|A new Oracle security based weblog|1|[b]9|20|2004|3|9|53|PM[/b]|0|0|2|no||open|||yes we need to create Mon, 20 sep 2004 15:09:53 GMT The seconds bit is fine, thanks, i didnt know i could get it in the entry, Sep should be fine to calculate but to work out that this day was monday was harder from scratch. I also cannot use the Gm_Utils code in the old feed due to the license. I will of course use our code in the new feeds. The C tm struct is the 9 feilds returned by localtime. I suppose we could just write the code to work out the day of the week? That would be a largish change, because almost everything looks at those date fields. However, there is good news. The Gm_Utils::getStdDate (get standard date) will tell you what day of the week it is, etc. It accounts for leap years, etc. Until everything is using the Gm_Storage mechanisms it will be very hard to change the underlying date format. Also, the API doc in Gm_Storage shows that the seconds are stored for each entry. Basically, it sounds like you may want to work off the entry instead of entrylist? Otherwise, it might be easier to add a new field to the entrylist, rssdate or something more generic, that is more of a standard date. I think adding will cause less issues then modifying existing. I can understand wanting to avoid the overhead of opening each entry, and using the convenient entrylist. What would a standard date format be? Or rather, what format is the C tm struct format? cheers Pete
|
|
|
Post by coldstone on May 7, 2007 14:44:15 GMT -5
Duh, I forgot that getStdDate gets a new date. However, the Gm_Storage::getEntry code documents each of those fields: - id = numeric, never 0
- author = alphanumeric
- subject = title of post alphanumeric (we hope)
- weekday = numeric (0-6, 0=Sunday, 1=Monday, etc.)
- month = month of post numeric (1-12, no leading zeroes)
- day = day of post numeric (1-31, no leading zeroes)
- year = year of post numeric (format: yyyy)
- hour = hour of post numeric (1-12, no leading zeroes)
- minute = minute of post numeric (1-12, no leading zeroes)
- second = second of post numeric (1-12, no leading zeroes)
- ampm = either AM or PM
- ...
So from your example, it looks like that entry is from a Monday? Gm_Core does a bunch of translations of the code and it uses this logic alot (where 'thisentryweekday is the value from the entry file): (Gm_Constants::DAYS)[$thisentryweekday]; # will return Sunday - Sat (Gm_Constants::DAYS_SHORT)[$thisentryweekday]; # will return Sun - Sat
I think the entry file has everything needed for rss, but if it helps performance, it might be useful to put some of that date/time information in the entrylist. I was thinking we would want to put it in a non-string format so it could be easily reformatted as needed.
|
|
|
Post by ambercromby on May 10, 2007 14:18:26 GMT -5
I've install the latest GM 1.7.2 and gm-rss 2.1 and I'm getting the following error.
Software error:
XML::Atom::SimpleFeed::new(): Unknown element modified at /path_to/gm-rss.cgi line 245
If I comment out all of the Atom sections, all of 2 places, I'm able to get the .rdf and .rss files built.
Other than that, this works great.
|
|
|
Post by petefinnigan on May 11, 2007 7:44:19 GMT -5
Hi,
the issue is almost certainly the version. You need to use version 0.7 of the xml::atom::simplifiedfeed package
hth
cheers
Pete
|
|
|
Post by ambercromby on May 12, 2007 11:59:41 GMT -5
Thanks Pete,
Not sure how I missed the entire first page with all that juicy info on it. I'll give it a try and see what happens.
Another oddity is that on the RSS page I'm seeing html code and when I look at the code on the displayed page it is "<p>"
Paul
|
|
|
Post by ambercromby on May 12, 2007 16:40:53 GMT -5
That did the trick, I've got all the feeds working. I know this doesn't have anything to do do with GM or RSS, but for some reason the fonts get messed up on the .rss and .rdf, but builds fine on the .xml. The ' and " show up as an accented a. If you have any ideas as to where I should look, I would appreciate it. The site is www.islandguardian.com if you want to look. Paul
|
|
|
Post by petefinnigan on May 29, 2007 9:54:41 GMT -5
Hi Paul,
sorry couldnt see an obvious solution. You could check your language setting in gm-rss and also in the apache config?
cheers
Pete
|
|
|
Post by saltor on Jun 8, 2007 16:53:37 GMT -5
I've now been able to get RSS working with the latest version of GM. I can generate the RSS feed using the manual command.
I've tried to use Kattie gm-rss auto without luck. I may not be putting the statement in the correct places. Can someone provide a copy of gm-library.cgi with the statement correctly entered? thanks.
|
|
|
Post by petefinnigan on Jun 11, 2007 11:44:36 GMT -5
Sorry, what is Kattie? - There was some notes in the original Bananabob code that suggested where to put the calls to gm-rss. I have not implemented them in this version. The new rss feed code will be integrated into GM so will not need adding or need external libraries.
let me know what you mean by Kattie and I will see if i can help
cheers
Pete
|
|