Permalink
Browse files

JSON for Videos

  • Loading branch information...
1 parent 1ec577c commit 3e231205a197e6f4b965986eae46a17b4a1ebd31 @georgevreilly committed Feb 2, 2013
Showing with 57 additions and 0 deletions.
  1. +14 −0 gae_flask_app/videos.py
  2. +24 −0 test-videos.json
  3. +19 −0 videos.json
View
@@ -0,0 +1,14 @@
+import os
+import json
+import codecs
+
+def json_path(filename):
+ return os.path.join(os.path.abspath(os.path.dirname(__name__)), filename)
+
+def load_video_json(filename):
+ with codecs.open(json_path(filename), encoding='utf-8') as fp:
+ return json.load(fp)
+
+if __name__ == '__main__':
+ print load_video_json("videos.json")
+ print load_video_json("test-videos.json")
View
@@ -0,0 +1,24 @@
+{
+ "videos": {
+ "bellringer": {
+ "url": "http://youtu.be/57M3rKfYnpg",
+ "title": "Bell Ringer at College Football Game",
+ "duration": 10
+ },
+ "supermariobros": {
+ "url": "http://youtu.be/yr_Rpk9HR1g",
+ "title": "Super Марио Brothers",
+ "duration": 7
+ },
+ "stapler": {
+ "url": "http://youtu.be/UiyDmqO59QE",
+ "title": "Missing",
+ "duration": 8
+ },
+ "karma": {
+ "url": "http://youtu.be/LVQVpuaB-nc",
+ "title": "Un Gol Bastante Raro",
+ "duration": 11
+ }
+ }
+}
View
@@ -0,0 +1,19 @@
+{
+ "videos": {
+ "godaddy": {
+ "url": "http://youtu.be/o-3j4-4N3Ng",
+ "title": "Perfect Match - Bar Refaeli's Big Kiss!",
+ "duration": 10
+ },
+ "hyundai": {
+ "url": "http://youtu.be/3jEU7yd4yuI",
+ "title": "2013 Hyundai Santa Fe | \"Don't Tell\"",
+ "duration": 10
+ },
+ "budweiser": {
+ "url": "http://youtu.be/o2prAccclXs",
+ "title": "The Clydesdales: \"Brotherhood\"",
+ "duration": 10
+ }
+ }
+}

0 comments on commit 3e23120

Please sign in to comment.