Created
May 7, 2013 08:48
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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