Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Serve "videos" in random order

  • Loading branch information...
commit 434773e79aa58521a1a502978e3b9088f172a9f5 1 parent d2f78e6
George V. Reilly authored
Showing with 17 additions and 0 deletions.
  1. +2 −0  gae_flask_app/AdYouLation/handlers.py
  2. +15 −0 test-videos.json
2  gae_flask_app/AdYouLation/handlers.py
View
@@ -1,8 +1,10 @@
from ..AdYouLation import AdYouLation
from flask import render_template, current_app
+import random
@AdYouLation.route('/start')
def start():
videos = current_app.videos
keys = videos["videos"].keys()
+ random.shuffle(keys)
return render_template("start.html", names=keys)
15 test-videos.json
View
@@ -19,6 +19,21 @@
"url": "http://youtu.be/LVQVpuaB-nc",
"title": "Un Gol Bastante Raro",
"duration": 11
+ },
+ "signpunch": {
+ "url": "http://youtu.be/rZt0avHRR00",
+ "title": "This is why you don't punch street signs",
+ "duration": 5
+ },
+ "cocaine": {
+ "url": "http://youtu.be/CmC62Eg82E8",
+ "title": "Henry the Hoover's cocaine overdose",
+ "duration": 17
+ },
+ "i_so_pale": {
+ "url": "http://youtu.be/ab0ddj6hadM",
+ "title": "I So Pale FAIL news blooper 2012",
+ "duration": 15
}
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.