SOPA Protest in Google App Engine

Just for trivia, this is how I implemented the SOPA protest page yesterday.

class Sopa(webapp.RequestHandler):
  """Handler for 503 protest Sopa response."""
  def get(self):
    self.response.set_status(503, 'Service Unavailable')
    self.response.out.write(
      '<p><b>503: Service Unavailable</b></p>' +
      '<p>www.javiertordable.com is not available today in protest with ' +
      'the <a href=\"http://sopastrike.com/\>>Stop Online Piracy Act ' +
      '(SOPA)</a>.</p>')

This would work for any simple Python wsgi Google App Engine application

def main():
  application = webapp.WSGIApplication([('\.*', Sopa)], debug = False)
  util.run_wsgi_app(application)