From: Jim Hu <ji...@ta...> - 2005-02-28 20:28:10
|
seminartitle and host are fields defined in the most recent version of the rss.php in the CVS, which I had customized after the last release version. I added those fields because the ones in the release didn't have some information I wanted. I probably should have removed them or named them something more general before posting it (Sorry, Chad!)...I uploaded my version to provide the date range capability, and to show how this could be used to have a single code block generate the feed, instead of different ones for day, week, and month. To use magpie with the older rss.php, the fields are: title link description rss.php takes the fields defined in the master array and tags them to conform to the RSS format well enough for magpie or other parsers to parse...I like magpie because a) it is used by another package I use and b) it's pretty simple and forgiving. As modified by me, the rss feed does not conform to an RDF calendar specification where the tag names are registered and so on. When I tried to read about calendar rss specifications, it seemed like the standards were not well defined at the time (about 9 months ago?)...and/or it was too confused for an amateur like me to understand! You can see these by looking at the rss feed you get as text (just paste the URL in your browser and view source). It's XML, so there are tags surrounding the data for each item. Each event looks something like: <item> <tag1>data</tag1> <tag2>data</tag2> etc. </item> And there are tags surrounding the whole feed. Hope this helps...and anyone out there who understands RDF better should suggest how to make things compliant! Jim Hu <snip> > Message: 1 > Date: Sat, 26 Feb 2005 15:29:13 +0000 > From: Ben Francis <li...@hi...> > To: php...@li... > Subject: Re: [PHPiCalendar-DEV] Using the ranges with the rss.php in > the CVS > Reply-To: php...@li... > > Jim Hu wrote: > >> p.s. Here's an example of how I use phpicalendar and magpie to >> generate a page with a range of events <snip> > > Wow, that's cool. > > I apologise, I'm not versed on the inner working of phpicalendar or > RSS, > certainly not magpierss. But I don't understand how you define the > fields(?) in the RSS feed if it's generated from a .ics file. > > For example, $item['seminartitle'] and $item['seminarhost']. Where do > these come from? I'd love to be able to define fields like "director", > "rating" and "stars" for a film showing in my calendar. But how are > these entered at the calendar stage? > > Also, Do I have to download the most recent rss.php from the CVS in > order to use this? > > Thanks > > tola > > -- > Ben "tola" Francis http://hippygeek.co.uk > ---------------------------------------------------- > COMPUTER SUPPORT for small businesses and home users > http://tolatech.co.uk > ---------------------------------------------------- > <snip> |
From: Ben F. <li...@hi...> - 2005-03-02 11:24:56
|
Jim Hu wrote: > I added those fields because the ones in the release didn't have some > information I wanted. I probably should have removed them or named > them something more general before posting it (Sorry, Chad!)... Right, I've hacked around with your version of rss.php and it's now generating yet another different XML document, where an item looks like: <item> <uid>5E2CE264-8A5F-11D9-AC32-000D936C280E-RID</uid> <title>recurring event</title> <link>http://www.catmosearts.co.uk:80/calendar/week.php?getdate=20050302&cal=exhibitions</link> <description>with description</description> <calname>exhibitions</calname> <starttime>6:45 PM</starttime> <endtime>7:45 PM</endtime> <startdate>March 2</startdate> <enddate>March 5</enddate> </item> Where end date is the end date of a recurring event, UID is grabbed for each item from the array key and other fields are hacked around a little for my needs. It's a bit of a pain that the iCal parser doesn't include a year in the $master_array["recur"]["UNTIL"] - wouldn't it be better to use a UNIX time or "20050302" consistently for everything? In fact, why doesn't it break when you have a recurring event covering several years? > I uploaded my version to provide the date range capability, and to > show how this could be used to have a single code block generate the > feed, instead of different ones for day, week, and month. OK, that should be good. But assuming I get that working, I have one more problem. rss.php generates an XML <item> for every occurence of a recurring event. I only want one <item> which states the start date and end date for an event. > As modified by me, the rss feed does not conform to an RDF calendar > specification where the tag names are registered and so on. When I > tried to read about calendar rss specifications, it seemed like the > standards were not well defined at the time (about 9 months > ago?)...and/or it was too confused for an amateur like me to understand! I also tried to look for an RDF calendar specification, got thoroughly confused and gave up and just did my own XML setup. Anyone want to do this? > Hope this helps... Yes, thank you. It does seem a little odd changing from .ics to an array to XML, back to an array but it works! And if I'm right magpierss will cache it all as well so the calendar file doesn't have to be parsed every time. > and anyone out there who understands RDF better should suggest how to > make things compliant! tola -- Ben "tola" Francis http://hippygeek.co.uk ---------------------------------------------------- COMPUTER SUPPORT for small businesses and home users http://tolatech.co.uk ---------------------------------------------------- |
From: Greg W. <php...@gr...> - 2005-03-02 14:52:03
|
A couple of comments: First, I think that a UNIX timestamp or some other form that includes as much information as possible should be sent in the RSS. That way, people can decide for themselves how to display the date and/or time. Having it automatically inserted in the title in a particular format (Jim's solution) or even just displayed in a format that doesn't include the year (Ben's) makes it more awkward to format it yourself. I think it's probably trivial to reformat it with date() and strtotime(), but one way or another we should pick a date format and stick to it, so code doesn't have to be rewritten each time. Second, I tried to send a comment about this earlier, but my e-mails from a non-subscribed address haven't (I don't think) been approved yet: the last time I checked, if you set up a 'daysfrom' RSS feed using Jim's solution that spans less than 100 days, it won't work properly when it reaches the end of the month. This is because dates in PHPiCalendar seem to rely on being in a format that makes months 100 days. I can't figure out how to get the information about how long a given month actually is. Anyways, Jim may have fixed this with a change he made earlier this week, but I haven't tested it yet. Thanks for working on this; it's a great addition to PHPiCalendar. Greg Westin -- http://www.gregwestin.com Contact info: http://www.gregwestin.com/contact.php On Mar 2, 2005, at 5:25 AM, Ben Francis wrote: > Jim Hu wrote: > >> I added those fields because the ones in the release didn't have >> some information I wanted. I probably should have removed them or >> named them something more general before posting it (Sorry, Chad!)... > > Right, I've hacked around with your version of rss.php and it's now > generating yet another different XML document, where an item looks > like: > > <item> > <uid>5E2CE264-8A5F-11D9-AC32-000D936C280E-RID</uid> > <title>recurring event</title> > <link>http://www.catmosearts.co.uk:80/calendar/week.php? > getdate=20050302&cal=exhibitions</link> > <description>with description</description> > <calname>exhibitions</calname> > <starttime>6:45 PM</starttime> > <endtime>7:45 PM</endtime> > <startdate>March 2</startdate> > <enddate>March 5</enddate> > </item> > > Where end date is the end date of a recurring event, UID is grabbed > for each item from the array key and other fields are hacked around a > little for my needs. > > It's a bit of a pain that the iCal parser doesn't include a year in > the $master_array["recur"]["UNTIL"] - wouldn't it be better to use a > UNIX time or "20050302" consistently for everything? In fact, why > doesn't it break when you have a recurring event covering several > years? > >> I uploaded my version to provide the date range capability, and to >> show how this could be used to have a single code block generate the >> feed, instead of different ones for day, week, and month. > > OK, that should be good. But assuming I get that working, I have one > more problem. rss.php generates an XML <item> for every occurence of a > recurring event. I only want one <item> which states the start date > and end date for an event. > >> As modified by me, the rss feed does not conform to an RDF calendar >> specification where the tag names are registered and so on. When I >> tried to read about calendar rss specifications, it seemed like the >> standards were not well defined at the time (about 9 months >> ago?)...and/or it was too confused for an amateur like me to >> understand! > > I also tried to look for an RDF calendar specification, got thoroughly > confused and gave up and just did my own XML setup. Anyone want to do > this? > >> Hope this helps... > > Yes, thank you. It does seem a little odd changing from .ics to an > array to XML, back to an array but it works! And if I'm right > magpierss will cache it all as well so the calendar file doesn't have > to be parsed every time. > >> and anyone out there who understands RDF better should suggest how to >> make things compliant! > > > tola > > -- > > Ben "tola" Francis http://hippygeek.co.uk > ---------------------------------------------------- > COMPUTER SUPPORT for small businesses and home users > http://tolatech.co.uk > ---------------------------------------------------- > > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real > users. > Discover which products truly live up to the hype. Start reading now. > http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click > _______________________________________________ > Phpicalendar-devel mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpicalendar-devel |
From: Ben F. <li...@hi...> - 2005-03-02 16:30:33
|
Greg Westin wrote: >First, I think that a UNIX timestamp or some other form that includes >as much information as possible should be sent in the RSS. > Agreed! This problem may trace back to ical_parser.php ? I'm not sure. Argh, how do I get my line breaks back in the description field? They disappear somewhere around the rss.php stage I think. Can anyone help? Oh and if you're trying to use mapgierss on a php version earlier than 4.2.0 then you'll need to download pear's PHP_Compat to get the array_cahnge_key_case() function to include in your script. See http://pear.php.net/package/PHP_Compat (thanks to aidan at php dot net for this advice on php.net) tola -- Ben "tola" Francis http://hippygeek.co.uk ---------------------------------------------------- COMPUTER SUPPORT for small businesses and home users http://tolatech.co.uk ---------------------------------------------------- |
From: Ben F. <li...@hi...> - 2005-03-03 15:23:00
|
Jim Hu wrote: > anyone out there who understands RDF better should suggest how to make > things compliant! I don't understand RDF better. But having a quick Google on this, http://www.w3.org/2002/12/cal/rfc2445.html looks like the specification. Do we know if anyone has yet written a tool to convert an iCalendar file to this format? Is this a useful direction for phpicalendar to go in - there are a lot of good reasons for it like syndication and integration with other data etc. To me it looks like a bit of a mammoth task, but workable. tola P.S. I still haven't got my linebreaks back. -- Ben "tola" Francis http://hippygeek.co.uk ---------------------------------------------------- COMPUTER SUPPORT for small businesses and home users http://tolatech.co.uk ---------------------------------------------------- |