Skip to content

Instantly share code, notes, and snippets.

@mcroydon
Created March 25, 2011 05:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcroydon/886387 to your computer and use it in GitHub Desktop.
Save mcroydon/886387 to your computer and use it in GitHub Desktop.
Source to isitfridayfridayfriday.appspot.com
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
class IsItFridayFridayFridayHandler(webapp.RequestHandler):
def get(self):
self.response.out.write("""<html><head><title>Is it Friday Friday Friday?</title>
<style type="text/css">
.big {font-size: 5em; margin-top: 2.5em; margin-bottom: 1em;}
.center {text-align: center;}
.friday {color: green;}
.notfriday {color: red;}
</style>
<body><div class="big center">Maybe.</div>
<p class="center"><a href="http://en.wikipedia.org/wiki/Friday_(Rebecca_Black_song)">Huh?</a> -
<a href="https://gist.github.com/886387">code</a> - <a href="http://www.youtube.com/watch?v=3CBzT2pv1Jc">acoustic</a></p>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
today = new Date().getDay();
if (today == 5) {
$("div.big").replaceWith('<div class="big center friday">Yes.</div><div class="center"><iframe title="YouTube video player" width="640" height="390" autoplay="false" src="http://www.youtube.com/embed/Pi9W533aJp4" frameborder="0" allowfullscreen></iframe></div>');
}
else {
$("div.big").replaceWith('<div class="big center notfriday">No.</div><div class="center">');
}
});
</script>
</body></html>""")
def main():
application = webapp.WSGIApplication([('/', IsItFridayFridayFridayHandler)],
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