Skip to content

Instantly share code, notes, and snippets.

@mbiette
Created May 7, 2013 08:48
Show Gist options
  • Save mbiette/5531202 to your computer and use it in GitHub Desktop.
Save mbiette/5531202 to your computer and use it in GitHub Desktop.
Script to correct the timezone of an ical feed via Google App Engine
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
from google.appengine.api import urlfetch
class MainHandler(webapp.RequestHandler):
def get(self):
url = ""
result = urlfetch.fetch(url)
if result.status_code == 200:
out = result.content.replace("DTSTART","DTSTART;TZID=Europe/Copenhagen")
out = out.replace("DTEND","DTEND;TZID=Europe/Copenhagen")
out = out.replace("DTSTART;TZID=Europe/Copenhagen","DTSTART",2)
self.response.out.write(out)
def main():
application = webapp.WSGIApplication([('/', MainHandler)],
debug=True)
util.run_wsgi_app(application)
if __name__ == '__main__':
main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment