Well, I’ve got a basic iCal to Sun ONE publisher script.
It’s a standalone web server using the HTTP::Daemon module and friends. On a PUT request it does a standard Basic auth system, checking the auth against the login WCAP command. If that succeeds, it deletes all the events in the specified calendar, and then uploads the new calendar as a POST request to the import WCAP command. Getting the POST request was tricky — it needs to have the POST data specify a Content-Type of text/calendar, which the doc never seems to mention (if it doesn’t, it crashes the Sun ONE web server).
At the moment the app only deals with PUT requests, does not understand SSL, and only does mild argument parsing. It’s also single threaded. Ideally I’d like to have this replace the previous subscribe CGI (understanding GET requests and parsing the arguments better) and become multithreaded after some fashion. It’s fast right now, but if too many people start using it, particularly over slow links, it could become a bottleneck if it’s not threaded better (probably just forking for each request).
Posted by Rowan Littell at October 11, 2004 09:16 PM