From: Waitman C. G. <wa...@em...> - 2002-10-16 20:03:01
|
hello! well, perhaps we should leave the parser code alone... it wouldn't hurt my feelings. I was just looking for an easy way to get the data into a database. I was really stuggling with ical_parser.php trying to figure out how to implement the vtodo. I suppose it was just too complicated for me (I AM pretty much an uneducated hack). plus i have only been familiar with this project for a little while.... my current parser code now supports VALARM and VTODO records, and should be compatible with the other phpicalendar scripts. additionally, it should be compatible with mozilla, outlook and apple ics files. I think I can reduce my code about another 100 lines. Currently there is a lot of duplication going on because I wasn't sure about how to store the VTODOs etc. right now it sticks the alarms in master_array[-3] and the todos in master_array[-2], using the suggestions made by jared and bill fenner. I want to build a monster ics file, and time the thing. also - set my php.ini file for low memory allocation, and give it some good testing. here is a sample of the master_array it creates: Array ( [-3] => Array ( [20021022] => Array ( [1000] => Array ( [0] => Array ( [event_start] => 1100 [event_text] => Dentist Appt [event_end] => 1200 [event_length] => 60 [event_overlap] => 0 [description] => [uid] => 968757005 [status] => [alarm] => -PT1H [type] => VALARM [unixtimestart] => 1035309600 [unixtimeend] => 1035313200 ) ) ) ) [-2] => Array ( [20021009] => Array ( [0000] => Array ( [0] => Array ( [event_start] => 0000 [event_text] => data for sexappeal [event_end] => 0000 [event_length] => 00 [event_overlap] => 0 [description] => [uid] => 916143937 [status] => NEEDS-ACTION [alarm] => [type] => VTODO [unixtimestart] => 1034146800 [unixtimeend] => 1034751600 ) [1] => Array ( [event_start] => 0000 [event_text] => don's form and web site [event_end] => 0000 [event_length] => 00 [event_overlap] => 0 [description] => [uid] => 959420326 [status] => NEEDS-ACTION [alarm] => [type] => VTODO [unixtimestart] => 1034146800 [unixtimeend] => 1034751600 ) [2] => Array ( [event_start] => 0000 [event_text] => brideworld updates [event_end] => 0000 [event_length] => 00 [event_overlap] => 0 [description] => [uid] => 926179144 [status] => NEEDS-ACTION [alarm] => [type] => VTODO [unixtimestart] => 1034146800 [unixtimeend] => 1034751600 ) [3] => Array ( [event_start] => 0000 [event_text] => reports - dealflow [event_end] => 0000 [event_length] => 00 [event_overlap] => 0 [description] => [uid] => 900181173 [status] => COMPLETED [alarm] => [type] => VTODO [unixtimestart] => 1034146800 [unixtimeend] => 1034751600 ) [4] => Array ( [event_start] => 0000 [event_text] => montauk email for jason [event_end] => 0000 [event_length] => 00 [event_overlap] => 0 [description] => [uid] => 947654954 [status] => COMPLETED [alarm] => [type] => VTODO [unixtimestart] => 1034146800 [unixtimeend] => 1034751600 ) [5] => Array ( [event_start] => 0000 [event_text] => platt work for justin [event_end] => 0000 [event_length] => 00 [event_overlap] => 0 [description] => [uid] => 924600754 [status] => COMPLETED [alarm] => [type] => VTODO [unixtimestart] => 1034146800 [unixtimeend] => 1034751600 ) [6] => Array ( [event_start] => 0000 [event_text] => gotscraps crochet pattern discount [event_end] => 0000 [event_length] => 00 [event_overlap] => 0 [description] => [uid] => 938557324 [status] => COMPLETED [alarm] => [type] => VTODO [unixtimestart] => 1034146800 [unixtimeend] => 1034751600 ) [7] => Array ( [event_start] => 0000 [event_text] => buena park chamber secure payments [event_end] => 0000 [event_length] => 00 [event_overlap] => 0 [description] => [uid] => 915842962 [status] => NEEDS-ACTION [alarm] => [type] => VTODO [unixtimestart] => 1034146800 [unixtimeend] => 1034751600 ) [8] => Array ( [event_start] => 0000 [event_text] => propreviewphotography [event_end] => 0000 [event_length] => 00 [event_overlap] => 0 [description] => [uid] => 915514433 [status] => NEEDS-ACTION [alarm] => [type] => VTODO [unixtimestart] => 1034146800 [unixtimeend] => 1034751600 ) ) ) [20021010] => Array ( [0000] => Array ( [0] => Array ( [event_start] => 0000 [event_text] => invoice for adcom publishing [event_end] => 0000 [event_length] => 00 [event_overlap] => 0 [description] => review outstanding invoices for adcom publishing [uid] => 979849348 [status] => COMPLETED [alarm] => [type] => VTODO [unixtimestart] => 1034233200 [unixtimeend] => 1034751600 ) ) ) [20021014] => Array ( [0000] => Array ( [0] => Array ( [event_start] => 0000 [event_text] => BP Chamber Calendar [event_end] => 0000 [event_length] => 00 [event_overlap] => 0 [description] => link not working [uid] => 941055869 [status] => NEEDS-ACTION [alarm] => [type] => VTODO [unixtimestart] => 1034578800 [unixtimeend] => 1034751600 ) ) ) ) [-1] => valid cal file [20021015] => Array ( [1000] => Array ( [0] => Array ( [event_start] => 1000 [event_text] => Cal Tech Design [event_end] => 1145 [event_length] => 105 [event_overlap] => 0 [description] => [uid] => 902705443 [status] => [alarm] => [type] => VEVENT [unixtimestart] => 1034701200 [unixtimeend] => 1034707500 ) ) [1300] => Array ( [0] => Array ( [event_start] => 1300 [event_text] => Creative Resources [event_end] => 1700 [event_length] => 240 [event_overlap] => 0 [description] => resolve issues on list [uid] => 906774672 [status] => [alarm] => [type] => VEVENT [unixtimestart] => 1034712000 [unixtimeend] => 1034726400 ) ) ) [20021022] => Array ( [0900] => Array ( [0] => Array ( [event_start] => 0900 [event_text] => Creative Resources [event_end] => 1700 [event_length] => 480 [event_overlap] => 0 [description] => rebuild os x server and reconfigure squid and scripts [uid] => 981687214 [status] => [alarm] => [type] => VEVENT [unixtimestart] => 1035302400 [unixtimeend] => 1035331200 ) ) [1100] => Array ( [0] => Array ( [event_start] => 1100 [event_text] => Dentist Appt [event_end] => 1200 [event_length] => 60 [event_overlap] => 1 [description] => [uid] => 968757005 [status] => [alarm] => -PT1H [type] => VEVENT [unixtimestart] => 1035309600 [unixtimeend] => 1035313200 ) ) ) [20021115] => Array ( [1000] => Array ( [0] => Array ( [event_start] => 1000 [event_text] => Teacher Conference [event_end] => 1030 [event_length] => 30 [event_overlap] => 0 [description] => [uid] => 982787692 [status] => [alarm] => [type] => VEVENT [unixtimestart] => 1037383200 [unixtimeend] => 1037385000 ) ) ) ) a couple of things. I don't remove the \n from the descriptions because i would prefer to change these to <br> tags in the output, would look nicer. i added some extra pieces of information to the array. if it doesn't work with the other scripts they will need to be removed, however i don't foresee any problem. attached is my latest file. please review at your convenience. i appreciate all comments and criticisms! thanks and best waitman On Wed, 2002-10-16 at 12:18, Chad wrote: I'm not sure why we would need to re-write the parser, as its pretty well tested at this point. Jared and I have already started cleaning up and tweeking the file for more speed and flexability, trimming over 200 lines this morning. It should just be altered to handle the vtodo, which is fairly simple. I agree with Dre on placing it in the master array as [-2]. I don't see though that it has a date attached specifically, they just appear in iCal no matter the date they were created. Not sure how mozilla handles these. -C On Wednesday, October 16, 2002, at 08:43 AM, Waitman C. Gobble wrote: > I just noticed that some of the apple events have a "start" and > "duration" instead of "end time". this is easy to implement in my > previous parser script, i will update. > > thanks > > waitman > > > On Wed, 2002-10-16 at 08:26, Waitman C. Gobble wrote: > hello > > i am working on VTODO implementation. attached is my preliminary > code for review. I am at a point where i really need your comments, > etc. > > basically, the parser is redone. currently weighing in at only 181 > or so lines instead of 740, but it is not yet complete. the > overlapper thing needs some looking into. > > i would appreciate it if you could give it a try, and let me know > what you find. > > IMO, worse case is to extract the portions that handle VTODO and > integrate with existing ical_parser.php > > i estimate the final result could be around 250-350 lines of code. > > it appears to me to be fast, i would need to create and collect > data > with regards to performance to compare to previous ical_parser. > > it also appears to create a master_array that is compatible with > the > existing master_array, well i have added some stuff however some > things can easily be removed to make it compatible with the other > scripts if need be. > > also, there is basic VALARM support. the rfc specs out a bunch of > stuff with regards to VALARM, like being able to call a program > using a URI, and setting multiple alarms that continue for > prescribed durations, and specifying the alarm time relative to the > START or the END of the event BUT I don't think any software > currently implements these features - it appears to me that most > software just lets you say "warn me x amount of minutes (or > days/weeks/months) ahead of time before i am supposed to do this" > and that is all. Please note I have not seen Apple's program, > perhaps it allows more sophisticated alarm settings. > > but my feeling is that at least the beginning we can simply handle > the basic "alert at a certain amount of time before the event" > since > it seems that is all that is currently implemented in the clients. > > ALSO, with regard to VTODOs, how do you guys feel about keeping > them > in the master array, or would you like them in a different array. > currently the thing sticks them in the master array, with enough > info to segregate them in the content producing scripts. > > ALSO, with regard to VTIMEZONE. the rfc specs out some stuff but it > is labelled as "incomplete". Mozilla doesn't use it at all, how > about the apple software? the samples on the apple site "half" use > the timezone thing when indicating times, but the timezone data > itself is not present so you can't really do anything with it (at > least not by the standards in the spec). you could speculate the > timezone label but you might run into trouble down the road with > compatibility. > > > best regards, > > Waitman > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: viaVerio will pay you up to > $1,000 for every account that you consolidate with us. > http://ad.doubleclick.net/clk;4749864;7604308;v? > http://www.viaverio.com/consolidator/osdn.cfm > _______________________________________________ > Phpicalendar-devel mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpicalendar-devel ------------------------------------------------------- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm _______________________________________________ Phpicalendar-devel mailing list Php...@li... https://lists.sourceforge.net/lists/listinfo/phpicalendar-devel |