-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created a demo jupyter-notebook to display API return
- Loading branch information
Steven Pollack
committed
Mar 27, 2016
1 parent
22e8952
commit 053bda5
Showing
2 changed files
with
265 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,262 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"import requests, re" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 8, | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"dairy_queen_url = 'https://double-dipper.herokuapp.com/double-dips'\n", | ||
"params = {\n", | ||
" 'location': 'Berlin',\n", | ||
" 'days_from_now': 0,\n", | ||
" 'max_wait_mins': 60\n", | ||
"}" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 9, | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"r = requests.get(dairy_queen_url, params=params)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"metadata": { | ||
"collapsed": true | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"def filter_sony_center(x):\n", | ||
" name = x.get('name')\n", | ||
" info = x.get('info')\n", | ||
" if re.match('CineStar', name) and re.match('.*Sony.*', info):\n", | ||
" return True\n", | ||
" else:\n", | ||
" return False" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 12, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [], | ||
"source": [ | ||
"sony_center = next(filter(filter_sony_center, r.json()))" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 14, | ||
"metadata": { | ||
"collapsed": false | ||
}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Zoomania (OV) 13:30-15:18 -> Batman v Superman: Dawn of Justice (OV) 16:00-18:32 -> Hail, Caesar! (OV) 19:30-21:16 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"My Big Fat Greek Wedding 2 (OV) 13:30-15:04 -> Batman v Superman: Dawn of Justice (OV) 16:00-18:32 -> Hail, Caesar! (OV) 19:30-21:16 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Kung Fu Panda 3 (OV) 13:30-15:06 -> Batman v Superman: Dawn of Justice (OV) 16:00-18:32 -> Hail, Caesar! (OV) 19:30-21:16 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Zoomania (OV) 13:45-15:33 -> Batman v Superman: Dawn of Justice (OV) 16:00-18:32 -> Hail, Caesar! (OV) 19:30-21:16 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Zoomania (OV) 13:45-15:33 -> Kung Fu Panda 3 (OV) 16:30-18:06\n", | ||
"\n", | ||
"\n", | ||
"Die Bestimmung - Allegiant (OV) 13:45-15:45 -> Batman v Superman: Dawn of Justice (OV) 16:00-18:32 -> Hail, Caesar! (OV) 19:30-21:16 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Die Bestimmung - Allegiant (OV) 13:45-15:45 -> Kung Fu Panda 3 (OV) 16:30-18:06\n", | ||
"\n", | ||
"\n", | ||
"Die Bestimmung - Allegiant (OV) 13:45-15:45 -> Zoomania (OV) 16:45-18:33 -> Hail, Caesar! (OV) 19:30-21:16 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 14:00-16:32 -> Kung Fu Panda 3 (OV) 16:30-18:06\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 14:00-16:32 -> Zoomania (OV) 16:45-18:33 -> Hail, Caesar! (OV) 19:30-21:16 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 14:00-16:32 -> Zoomania (OV) 17:15-19:03 -> Hail, Caesar! (OV) 19:30-21:16 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 14:00-16:32 -> Zoomania (OV) 17:15-19:03 -> Deadpool (OV) 19:45-21:34 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 14:00-16:32 -> My Big Fat Greek Wedding 2 (OV) 17:15-18:49 -> Hail, Caesar! (OV) 19:30-21:16 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 14:00-16:32 -> My Big Fat Greek Wedding 2 (OV) 17:15-18:49 -> Deadpool (OV) 19:45-21:34 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 14:00-16:32 -> Die Bestimmung - Allegiant (OV) 17:30-19:30 -> Hail, Caesar! (OV) 19:30-21:16 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 14:00-16:32 -> Die Bestimmung - Allegiant (OV) 17:30-19:30 -> Deadpool (OV) 19:45-21:34 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 14:00-16:32 -> Die Bestimmung - Allegiant (OV) 17:30-19:30 -> Zoomania (OV) 20:00-21:48 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 14:00-16:32 -> Die Bestimmung - Allegiant (OV) 17:30-19:30 -> Rock the Kasbah (OV) 20:15-22:02 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 14:00-16:32 -> Die Bestimmung - Allegiant (OV) 17:30-19:30 -> Rock the Kasbah (OV) 20:15-22:02 -> London Has Fallen (OV) 23:00-00:39\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 14:00-16:32 -> Die Bestimmung - Allegiant (OV) 17:30-19:30 -> Raum (OV) 20:20-22:18 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 14:00-16:32 -> Die Bestimmung - Allegiant (OV) 17:30-19:30 -> Raum (OV) 20:20-22:18 -> London Has Fallen (OV) 23:00-00:39\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 14:00-16:32 -> Die Bestimmung - Allegiant (OV) 17:30-19:30 -> Raum (OV) 20:20-22:18 -> Deadpool (OV) 23:15-01:04\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 14:00-16:32 -> Die Bestimmung - Allegiant (OV) 17:30-19:30 -> Raum (OV) 20:20-22:18 -> Rock the Kasbah (OV) 23:15-01:02\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 14:00-16:32 -> Die Bestimmung - Allegiant (OV) 17:30-19:30 -> Raum (OV) 20:20-22:18 -> The Revenant - Der Rückkehrer (OV) 23:15-01:52\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 14:00-16:32 -> Die Bestimmung - Allegiant (OV) 17:30-19:30 -> My Big Fat Greek Wedding 2 (OV) 20:30-22:04 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 14:00-16:32 -> Die Bestimmung - Allegiant (OV) 17:30-19:30 -> My Big Fat Greek Wedding 2 (OV) 20:30-22:04 -> London Has Fallen (OV) 23:00-00:39\n", | ||
"\n", | ||
"\n", | ||
"Kung Fu Panda 3 (OV) 14:00-15:36 -> Batman v Superman: Dawn of Justice (OV) 16:00-18:32 -> Hail, Caesar! (OV) 19:30-21:16 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Raum (OV) 14:00-15:58 -> Batman v Superman: Dawn of Justice (OV) 16:00-18:32 -> Hail, Caesar! (OV) 19:30-21:16 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Raum (OV) 14:00-15:58 -> Kung Fu Panda 3 (OV) 16:30-18:06\n", | ||
"\n", | ||
"\n", | ||
"Raum (OV) 14:00-15:58 -> Zoomania (OV) 16:45-18:33 -> Hail, Caesar! (OV) 19:30-21:16 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 17:00-19:32 -> Hail, Caesar! (OV) 19:30-21:16 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 17:00-19:32 -> Deadpool (OV) 19:45-21:34 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 17:00-19:32 -> Zoomania (OV) 20:00-21:48 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 17:00-19:32 -> Rock the Kasbah (OV) 20:15-22:02 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 17:00-19:32 -> Rock the Kasbah (OV) 20:15-22:02 -> London Has Fallen (OV) 23:00-00:39\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 17:00-19:32 -> Raum (OV) 20:20-22:18 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 17:00-19:32 -> Raum (OV) 20:20-22:18 -> London Has Fallen (OV) 23:00-00:39\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 17:00-19:32 -> Raum (OV) 20:20-22:18 -> Deadpool (OV) 23:15-01:04\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 17:00-19:32 -> Raum (OV) 20:20-22:18 -> Rock the Kasbah (OV) 23:15-01:02\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 17:00-19:32 -> Raum (OV) 20:20-22:18 -> The Revenant - Der Rückkehrer (OV) 23:15-01:52\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 17:00-19:32 -> My Big Fat Greek Wedding 2 (OV) 20:30-22:04 -> The Big Short (OV) 22:15-00:26\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 17:00-19:32 -> My Big Fat Greek Wedding 2 (OV) 20:30-22:04 -> London Has Fallen (OV) 23:00-00:39\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 20:00-22:32 -> London Has Fallen (OV) 23:00-00:39\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 20:00-22:32 -> Deadpool (OV) 23:15-01:04\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 20:00-22:32 -> Rock the Kasbah (OV) 23:15-01:02\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 20:00-22:32 -> The Revenant - Der Rückkehrer (OV) 23:15-01:52\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 20:45-23:17 -> Deadpool (OV) 23:15-01:04\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 20:45-23:17 -> Rock the Kasbah (OV) 23:15-01:02\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 20:45-23:17 -> The Revenant - Der Rückkehrer (OV) 23:15-01:52\n", | ||
"\n", | ||
"\n", | ||
"Batman v Superman: Dawn of Justice (OV) 22:45-01:17\n", | ||
"\n", | ||
"\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"for double_dip in sony_center.get('doubleDips'):\n", | ||
" # double_dip is an array of movies\n", | ||
" print(' -> '.join([\"%s %s-%s\" % (movie.get('movie'), movie.get('startTime'), movie.get('endTime')) for movie in double_dip]))\n", | ||
" print('\\n')" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.5.1" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 0 | ||
} |