From ace9a686ea781fdee100586667d34de8e854bc99 Mon Sep 17 00:00:00 2001
From: brianschmitz
Date: Fri, 10 Jan 2014 18:01:07 -0800
Subject: [PATCH 01/19] Client completed
---
assignments/session01/echo_client.py | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/assignments/session01/echo_client.py b/assignments/session01/echo_client.py
index 61616c36..2dbc0a9c 100644
--- a/assignments/session01/echo_client.py
+++ b/assignments/session01/echo_client.py
@@ -6,16 +6,20 @@ def client(msg, log_buffer=sys.stderr):
server_address = ('localhost', 10000)
# TODO: Replace the following line with your code which will instantiate
# a TCP socket with IPv4 Addressing, call the socket you make 'sock'
- sock = None
+ sock = socket.socket(
+ socket.AF_INET,
+ socket.SOCK_STREAM,
+ socket.IPPROTO_IP)
+
print >>log_buffer, 'connecting to {0} port {1}'.format(*server_address)
# TODO: connect your socket to the server here.
-
+ sock.connect(server_address)
# this try/finally block exists purely to allow us to close the socket
# when we are finished with it
try:
print >>log_buffer, 'sending "{0}"'.format(msg)
# TODO: send your message to the server here.
-
+ sock.sendall(msg)
# TODO: the server should be sending you back your message as a series
# of 16-byte chunks. You will want to log them as you receive
# each one. You will also need to check to make sure that
@@ -24,12 +28,20 @@ def client(msg, log_buffer=sys.stderr):
#
# Make sure that you log each chunk you receive. Use the print
# statement below to do it. (The tests expect this log format)
- chunk = ''
- print >>log_buffer, 'received "{0}"'.format(chunk)
+ amount_received = 0
+ amount_expected = len(msg)
+ while amount_received < amount_expected:
+ chunk = sock.recv(16)
+ amount_received += len(chunk)
+ print >>log_buffer, 'received "{0}"'.format(chunk)
+
+
+
finally:
# TODO: after you break out of the loop receiving echoed chunks from
# the server you will want to close your client socket.
print >>log_buffer, 'closing socket'
+ sock.close()
if __name__ == '__main__':
From 47f89aa26d65e84eb99ac3bb2e93a3f1d6885a33 Mon Sep 17 00:00:00 2001
From: brianschmitz
Date: Fri, 10 Jan 2014 18:01:33 -0800
Subject: [PATCH 02/19] Server completed
---
assignments/session01/echo_server.py | 28 ++++++++++++++++++++--------
1 file changed, 20 insertions(+), 8 deletions(-)
diff --git a/assignments/session01/echo_server.py b/assignments/session01/echo_server.py
index 217380fb..927237c9 100644
--- a/assignments/session01/echo_server.py
+++ b/assignments/session01/echo_server.py
@@ -7,16 +7,21 @@ def server(log_buffer=sys.stderr):
address = ('127.0.0.1', 10000)
# TODO: Replace the following line with your code which will instantiate
# a TCP socket with IPv4 Addressing, call the socket you make 'sock'
- sock = None
+ sock = socket.socket(
+ socket.AF_INET,
+ socket.SOCK_STREAM,
+ socket.IPPROTO_TCP
+ )
# TODO: Set an option to allow the socket address to be reused immediately
# see the end of http://docs.python.org/2/library/socket.html
-
+ sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
# log that we are building a server
print >>log_buffer, "making a server on {0}:{1}".format(*address)
# TODO: bind your new sock 'sock' to the address above and begin to listen
# for incoming connections
-
+ sock.bind(address)
+ sock.listen(1)
try:
# the outer loop controls the creation of new connection sockets. The
# server will handle each incoming connection one at a time.
@@ -28,9 +33,10 @@ def server(log_buffer=sys.stderr):
# the client so we can report it below. Replace the
# following line with your code. It is only here to prevent
# syntax errors
- addr = ('bar', 'baz')
+ #addr = ('bar', 'baz')
+ conn, client_address = sock.accept()
try:
- print >>log_buffer, 'connection - {0}:{1}'.format(*addr)
+ print >>log_buffer, 'connection - {0}:{1}'.format(*client_address)
# the inner loop will receive messages sent by the client in
# buffers. When a complete message has been received, the
@@ -41,12 +47,17 @@ def server(log_buffer=sys.stderr):
# following line with your code. It's only here as
# a placeholder to prevent an error in string
# formatting
- data = ''
+ data = conn.recv(16)
print >>log_buffer, 'received "{0}"'.format(data)
# TODO: you will need to check here to see if any data was
# received. If so, send the data you got back to
# the client. If not, exit the inner loop and wait
# for a new connection from a client
+ if not data:
+ break
+ conn.send(data)
+
+
finally:
# TODO: When the inner loop exits, this 'finally' clause will
@@ -54,14 +65,15 @@ def server(log_buffer=sys.stderr):
# created above when a client connected. Replace the
# call to `pass` below, which is only there to prevent
# syntax problems
- pass
+ conn.close()
except KeyboardInterrupt:
# TODO: Use the python KeyboardIntterupt exception as a signal to
# close the server socket and exit from the server function.
# Replace the call to `pass` below, which is only there to
# prevent syntax problems
- pass
+ sock.close()
+ sys.exit()
if __name__ == '__main__':
From 8389cc29418d54df431f47b1b559ec8cdc5e9c1b Mon Sep 17 00:00:00 2001
From: brianschmitz
Date: Fri, 10 Jan 2014 18:06:57 -0800
Subject: [PATCH 03/19] Complete
---
.idea/.name | 1 +
.idea/encodings.xml | 5 +
.idea/misc.xml | 5 +
.idea/modules.xml | 9 +
.idea/scopes/scope_settings.xml | 5 +
.idea/training.python_web.iml | 16 +
.idea/vcs.xml | 7 +
.idea/workspace.xml | 547 ++++++++++++++++++++++++++++++++
8 files changed, 595 insertions(+)
create mode 100644 .idea/.name
create mode 100644 .idea/encodings.xml
create mode 100644 .idea/misc.xml
create mode 100644 .idea/modules.xml
create mode 100644 .idea/scopes/scope_settings.xml
create mode 100644 .idea/training.python_web.iml
create mode 100644 .idea/vcs.xml
create mode 100644 .idea/workspace.xml
diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 00000000..9542d354
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+training.python_web
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 00000000..e206d70d
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 00000000..39c829f6
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 00000000..743ed207
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,9 @@
+
+
+
+
+
+
+
+
+
diff --git a/.idea/scopes/scope_settings.xml b/.idea/scopes/scope_settings.xml
new file mode 100644
index 00000000..922003b8
--- /dev/null
+++ b/.idea/scopes/scope_settings.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/training.python_web.iml b/.idea/training.python_web.iml
new file mode 100644
index 00000000..18de24d8
--- /dev/null
+++ b/.idea/training.python_web.iml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 00000000..c80f2198
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 00000000..1579ebcb
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,547 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
-
+
-
-
-
-
-
+
-
+
-
-
-
-
-
+
-
+
-
-
-
+
-
+
-
-
-
-
+
+
-
+
-
+
-
-
-
-
+
-
-
+
+
+
+
diff --git a/assignments/session02/http_server.py b/assignments/session02/http_server.py
index 21a033f2..1aff7f28 100644
--- a/assignments/session02/http_server.py
+++ b/assignments/session02/http_server.py
@@ -3,7 +3,7 @@
import mimetypes
-def response_ok(*args):
+def response_ok(body, mimetyp):
"""returns a basic HTTP response"""
if not args:
body = "this is a pretty minimal response"
diff --git a/assignments/session03/.cache/api.eventful.com,json,events,search,q=cycling&l=Seattle&app_key=test_key,22de6f7c4f73ac9c59368db27552cd97 b/assignments/session03/.cache/api.eventful.com,json,events,search,q=cycling&l=Seattle&app_key=test_key,22de6f7c4f73ac9c59368db27552cd97
new file mode 100644
index 00000000..2878cf6c
--- /dev/null
+++ b/assignments/session03/.cache/api.eventful.com,json,events,search,q=cycling&l=Seattle&app_key=test_key,22de6f7c4f73ac9c59368db27552cd97
@@ -0,0 +1,8 @@
+status: 200
+content-length: 13688
+content-location: http://api.eventful.com/json//events/search?q=cycling&l=Seattle&app_key=test_key
+server: lighttpd/1.4.28
+date: Tue, 28 Jan 2014 18:00:36 GMT
+content-type: text/javascript; charset=utf-8
+
+{"last_item":null,"total_items":"86","first_item":null,"page_number":"1","page_size":"10","page_items":null,"search_time":"0.028","page_count":"9","events":{"event":[{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":"98073","going_count":null,"all_day":"0","latitude":"47.6742","groups":null,"url":"http://seattle.eventful.com/events/cycling-event-redspoke-2014-/E0-001-064398941-3@2014071607?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-064398941-3@2014071607","privacy":"1","city_name":"Redmond","link_count":null,"longitude":"-122.121","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-07-16 07:30:00","tz_id":null,"description":" ","modified":"2014-01-24 08:11:36","venue_display":"1","tz_country":null,"performers":null,"title":"Cycling Event - RedSpoke 2014","venue_address":null,"geocode_type":"Zip Code Based GeoCodes","tz_olson_path":null,"recur_string":"daily until July 20, 2014","calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2013-12-03 23:58:17","venue_id":"V0-001-002355411-0","tz_city":null,"stop_time":null,"venue_name":"Redmond, WA to Spokane, WA","venue_url":"http://seattle.eventful.com/venues/redmond-wa-to-spokane-wa-/V0-001-002355411-0?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":"98198","going_count":null,"all_day":"2","latitude":"47.3861","groups":null,"url":"http://seattle.eventful.com/events/ladies-only-cycling-tour-cycling-san-juans-/E0-001-064407533-7?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-064407533-7","privacy":"1","city_name":"Seattle","link_count":null,"longitude":"-122.304","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-05-11 00:00:00","tz_id":null,"description":" ","modified":"2014-01-17 02:42:18","venue_display":"1","tz_country":null,"performers":null,"title":"Ladies Only Cycling Tour - Cycling the San Juans","venue_address":"20717 International Blvd","geocode_type":"Zip Code Based GeoCodes","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2013-12-04 03:14:57","venue_id":"V0-001-007518635-2","tz_city":null,"stop_time":"2014-05-16 00:00:00","venue_name":"San Juan Islands","venue_url":"http://seattle.eventful.com/venues/san-juan-islands-/V0-001-007518635-2?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":"98040","going_count":null,"all_day":"0","latitude":"47.5602","groups":null,"url":"http://seattle.eventful.com/events/path-pedal-against-trafficking-humans-ride-/E0-001-064399183-4?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-064399183-4","privacy":"1","city_name":"Mercer Island","link_count":null,"longitude":"-122.228","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-03-30 08:00:00","tz_id":null,"description":" ","modified":"2014-01-07 13:39:48","venue_display":"1","tz_country":null,"performers":null,"title":"PATH (Pedal Against Trafficking Humans) Ride","venue_address":"2750 77th Ave SE","geocode_type":"Zip Code Based GeoCodes","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2013-12-04 00:12:22","venue_id":"V0-001-007516834-7","tz_city":null,"stop_time":null,"venue_name":"Veloce Velo Bicycles","venue_url":"http://seattle.eventful.com/venues/veloce-velo-bicycles-/V0-001-007516834-7?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":null,"going_count":null,"all_day":"0","latitude":"47.6514320","groups":null,"url":"http://seattle.eventful.com/events/tour-pro-performance-cycling-/E0-001-066157804-4?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-066157804-4","privacy":"1","city_name":"Bellevue","link_count":null,"longitude":"-122.1451520","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-02-10 06:00:00","tz_id":null,"description":" Location: Bellevue - Cycling Studio
Description: Maximize your cycling performance & get the results you want! This challenging ride will motivate you to increase your speed, stamina, and strength on the bike.","modified":"2014-01-25 16:33:23","venue_display":"1","tz_country":null,"performers":null,"title":"Tour de PRO: Performance Cycling","venue_address":"4455 148th Avenue N E","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2014-01-25 16:33:23","venue_id":"V0-001-000610995-9","tz_city":null,"stop_time":null,"venue_name":"Pro Sports Club - Bellevue","venue_url":"http://seattle.eventful.com/venues/pro-sports-club-bellevue-/V0-001-000610995-9?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":null,"going_count":null,"all_day":"0","latitude":"47.6514320","groups":null,"url":"http://seattle.eventful.com/events/tour-pro-performance-cycling-/E0-001-066157802-6?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-066157802-6","privacy":"1","city_name":"Bellevue","link_count":null,"longitude":"-122.1451520","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-02-10 09:15:00","tz_id":null,"description":" Location: Bellevue - Cycling Studio
Description: Maximize your cycling performance & get the results you want! This challenging ride will motivate you to increase your speed, stamina, and strength on the bike.","modified":"2014-01-25 16:33:22","venue_display":"1","tz_country":null,"performers":null,"title":"Tour de PRO: Performance Cycling","venue_address":"4455 148th Avenue N E","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2014-01-25 16:33:22","venue_id":"V0-001-000610995-9","tz_city":null,"stop_time":null,"venue_name":"Pro Sports Club - Bellevue","venue_url":"http://seattle.eventful.com/venues/pro-sports-club-bellevue-/V0-001-000610995-9?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":null,"going_count":null,"all_day":"0","latitude":"47.6514320","groups":null,"url":"http://seattle.eventful.com/events/tour-pro-performance-cycling-/E0-001-066157817-8?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-066157817-8","privacy":"1","city_name":"Bellevue","link_count":null,"longitude":"-122.1451520","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-02-12 09:15:00","tz_id":null,"description":" Location: Bellevue - Cycling Studio
Description: Maximize your cycling performance & get the results you want! This challenging ride will motivate you to increase your speed, stamina, and strength on the bike.","modified":"2014-01-25 16:33:41","venue_display":"1","tz_country":null,"performers":null,"title":"Tour de PRO: Performance Cycling","venue_address":"4455 148th Avenue N E","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2014-01-25 16:33:41","venue_id":"V0-001-000610995-9","tz_city":null,"stop_time":null,"venue_name":"Pro Sports Club - Bellevue","venue_url":"http://seattle.eventful.com/venues/pro-sports-club-bellevue-/V0-001-000610995-9?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":null,"going_count":null,"all_day":"0","latitude":"47.6514320","groups":null,"url":"http://seattle.eventful.com/events/tour-pro-performance-cycling-/E0-001-066157815-0?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-066157815-0","privacy":"1","city_name":"Bellevue","link_count":null,"longitude":"-122.1451520","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-02-05 09:15:00","tz_id":null,"description":" Location: Bellevue - Cycling Studio
Description: Maximize your cycling performance & get the results you want! This challenging ride will motivate you to increase your speed, stamina, and strength on the bike.","modified":"2014-01-25 16:33:38","venue_display":"1","tz_country":null,"performers":null,"title":"Tour de PRO: Performance Cycling","venue_address":"4455 148th Avenue N E","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2014-01-25 16:33:38","venue_id":"V0-001-000610995-9","tz_city":null,"stop_time":null,"venue_name":"Pro Sports Club - Bellevue","venue_url":"http://seattle.eventful.com/venues/pro-sports-club-bellevue-/V0-001-000610995-9?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":null,"going_count":null,"all_day":"0","latitude":"47.6514320","groups":null,"url":"http://seattle.eventful.com/events/tour-pro-performance-cycling-/E0-001-066157812-3?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-066157812-3","privacy":"1","city_name":"Bellevue","link_count":null,"longitude":"-122.1451520","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-02-10 18:00:00","tz_id":null,"description":" Location: Bellevue - Cycling Studio
Description: Maximize your cycling performance & get the results you want! This challenging ride will motivate you to increase your speed, stamina, and strength on the bike.","modified":"2014-01-25 16:33:34","venue_display":"1","tz_country":null,"performers":null,"title":"Tour de PRO: Performance Cycling","venue_address":"4455 148th Avenue N E","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2014-01-25 16:33:34","venue_id":"V0-001-000610995-9","tz_city":null,"stop_time":null,"venue_name":"Pro Sports Club - Bellevue","venue_url":"http://seattle.eventful.com/venues/pro-sports-club-bellevue-/V0-001-000610995-9?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":null,"going_count":null,"all_day":"0","latitude":"47.6514320","groups":null,"url":"http://seattle.eventful.com/events/tour-pro-performance-cycling-/E0-001-065951104-6?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-065951104-6","privacy":"1","city_name":"Bellevue","link_count":null,"longitude":"-122.1451520","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-02-03 09:15:00","tz_id":null,"description":" Location: Bellevue - Cycling Studio
Description: Maximize your cycling performance & get the results you want! This challenging ride will motivate you to increase your speed, stamina, and strength on the bike.","modified":"2014-01-17 23:29:52","venue_display":"1","tz_country":null,"performers":null,"title":"Tour de PRO: Performance Cycling","venue_address":"4455 148th Avenue N E","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2014-01-17 23:29:52","venue_id":"V0-001-000610995-9","tz_city":null,"stop_time":null,"venue_name":"Pro Sports Club - Bellevue","venue_url":"http://seattle.eventful.com/venues/pro-sports-club-bellevue-/V0-001-000610995-9?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":null,"going_count":null,"all_day":"0","latitude":"47.6514320","groups":null,"url":"http://seattle.eventful.com/events/tour-pro-performance-cycling-/E0-001-065951115-2?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-065951115-2","privacy":"1","city_name":"Bellevue","link_count":null,"longitude":"-122.1451520","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-02-03 18:00:00","tz_id":null,"description":" Location: Bellevue - Cycling Studio
Description: Maximize your cycling performance & get the results you want! This challenging ride will motivate you to increase your speed, stamina, and strength on the bike.","modified":"2014-01-17 23:30:01","venue_display":"1","tz_country":null,"performers":null,"title":"Tour de PRO: Performance Cycling","venue_address":"4455 148th Avenue N E","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2014-01-17 23:30:01","venue_id":"V0-001-000610995-9","tz_city":null,"stop_time":null,"venue_name":"Pro Sports Club - Bellevue","venue_url":"http://seattle.eventful.com/venues/pro-sports-club-bellevue-/V0-001-000610995-9?utm_source=apis&utm_medium=apim&utm_campaign=apic"}]}}
diff --git a/assignments/session03/.cache/api.eventful.com,json,events,search,q=cycling&l=WA&app_key=test_key,b807e82ce475840821922fab3fb6aded b/assignments/session03/.cache/api.eventful.com,json,events,search,q=cycling&l=WA&app_key=test_key,b807e82ce475840821922fab3fb6aded
new file mode 100644
index 00000000..da3da59e
--- /dev/null
+++ b/assignments/session03/.cache/api.eventful.com,json,events,search,q=cycling&l=WA&app_key=test_key,b807e82ce475840821922fab3fb6aded
@@ -0,0 +1,8 @@
+status: 200
+content-length: 161
+content-location: http://api.eventful.com/json//events/search?q=cycling&l=WA&app_key=test_key
+server: lighttpd/1.4.28
+date: Tue, 28 Jan 2014 17:58:01 GMT
+content-type: text/javascript; charset=utf-8
+
+{"last_item":null,"total_items":"0","first_item":null,"page_number":"1","page_size":"10","page_items":null,"search_time":"0.018","page_count":"0","events":null}
diff --git a/assignments/session03/.cache/api.eventful.com,json,events,search,q=music&l=San+Diego&app_key=test_key,e31b486f6c8afe2e0f4a3a994f47970c b/assignments/session03/.cache/api.eventful.com,json,events,search,q=music&l=San+Diego&app_key=test_key,e31b486f6c8afe2e0f4a3a994f47970c
new file mode 100644
index 00000000..d9cd4ca0
--- /dev/null
+++ b/assignments/session03/.cache/api.eventful.com,json,events,search,q=music&l=San+Diego&app_key=test_key,e31b486f6c8afe2e0f4a3a994f47970c
@@ -0,0 +1,8 @@
+status: 200
+content-length: 21462
+content-location: http://api.eventful.com/json//events/search?q=music&l=San+Diego&app_key=test_key
+server: lighttpd/1.4.28
+date: Sun, 26 Jan 2014 17:23:55 GMT
+content-type: text/javascript; charset=utf-8
+
+{"last_item":null,"total_items":"1851","first_item":null,"page_number":"1","page_size":"10","page_items":null,"search_time":"0.053","page_count":"186","events":{"event":[{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"CA","postal_code":"92101","going_count":null,"all_day":"0","latitude":"32.7314520","groups":null,"url":"http://sandiego.eventful.com/events/first-friday-films-music-room-jalsaghar-/E0-001-066123521-9?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-066123521-9","privacy":"1","city_name":"San Diego","link_count":null,"longitude":"-117.1512999","country_name":"United States","country_abbr":"USA","region_name":"California","start_time":"2014-03-07 19:00:00","tz_id":null,"description":"
7:00 p.m. Pre-Film Lecture | 8:00 p.m. Film
Satyaijt Ray (1921-1992) was a master of Indian cinema and his work continues to be studied and discovered by audiences around the world. The Music Room, also known by its original title Jalsaghar, follows an aristocrat's weakening grip on power and the destruction of his personal and public life during a radical shift in Indian society when the feudal system was outlawed. Set in West Bengal, the film's protagonist remains committed to tradition, pride, and above all, organizing concerts of beautiful Indian music in his home.
Prior to the film, scholar and professor Aditi Chandra, Ph.D., will deliver a lecture analyzing the ways in which historical Indian monuments can inform our ideas about the development of modern Indian society and its social relations. Chandra is Assistant Professor in the School of Social Sciences, Humanities and Art at University of California, Merced.
Charcuterie and a Movie Package for Two Enjoy some nibbles and wine during the lecture and film. $50 members | $60 nonmembers
To guarantee availability, reserve your package online or by calling 619.696.1935 by 4:00 p.m. on Wednesday, March 5, 2014.
","modified":"2014-01-24 15:34:33","venue_display":"1","tz_country":null,"performers":{"performer":{"creator":"themusicroomband","linker":"evdb","name":"The Music Room","url":"http://concerts.eventful.com/The-Music-Room?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"P0-001-000219393-2","short_bio":"Folk Rock, Rock, Acoustic, Folk"}},"title":"First Friday Films: The Music Room, or Jalsaghar","venue_address":"1450 El Prado Balboa Park","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":{"small":{"width":"48","url":"http://s3.evcdn.com/images/small/I0-001/002/779/294-9.jpeg_/the-music-room-94.jpeg","height":"48"},"width":"48","caption":null,"medium":{"width":"128","url":"http://s3.evcdn.com/images/medium/I0-001/002/779/294-9.jpeg_/the-music-room-94.jpeg","height":"128"},"url":"http://s3.evcdn.com/images/small/I0-001/002/779/294-9.jpeg_/the-music-room-94.jpeg","thumb":{"width":"48","url":"http://s3.evcdn.com/images/thumb/I0-001/002/779/294-9.jpeg_/the-music-room-94.jpeg","height":"48"},"height":"48"},"created":"2014-01-24 15:34:33","venue_id":"V0-001-000106700-1","tz_city":null,"stop_time":null,"venue_name":"The San Diego Museum of Art","venue_url":"http://sandiego.eventful.com/venues/the-san-diego-museum-of-art-/V0-001-000106700-1?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"CA","postal_code":null,"going_count":null,"all_day":"0","latitude":"32.8446120","groups":null,"url":"http://sandiego.eventful.com/events/la-jolla-music-society-presents-chamber-music-socie-/E0-001-059121063-6?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-059121063-6","privacy":"1","city_name":"La Jolla","link_count":null,"longitude":"-117.2779420","country_name":"United States","country_abbr":"USA","region_name":"California","start_time":"2014-03-22 20:00:00","tz_id":null,"description":" La Jolla Music Society presents: Mozart: Quartet for Flute and Strings no 1 in D major, K 285; Mozart: Duo for Violin and Viola no 1 in G major, K 423; Currier: New Work; Villa-Lobos: Choros no 2 p...\n","modified":"2013-07-13 11:22:00","venue_display":"1","tz_country":null,"performers":{"performer":{"creator":"SPAHouston","linker":"evdb","name":"Chamber Music Society of Lincoln Center","url":"http://eventful.com/performers/chamber-music-society-of-lincoln-center-/P0-001-000144637-8?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"P0-001-000144637-8","short_bio":"one of 12 constituents of Lincoln Center for the Performing Arts, the largest performing arts complex in the world"}},"title":"La Jolla Music Society presents Chamber Music Society of Lincoln Center - Mozart Connections","venue_address":"700 Prospect Street","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":{"small":{"width":"48","url":"http://s2.evcdn.com/images/small/I0-001/014/374/981-0.jpeg_/la-jolla-music-society-presents-chamber-music-soci-81.jpeg","height":"48"},"width":"48","caption":null,"medium":{"width":"128","url":"http://s2.evcdn.com/images/medium/I0-001/014/374/981-0.jpeg_/la-jolla-music-society-presents-chamber-music-soci-81.jpeg","height":"128"},"url":"http://s2.evcdn.com/images/small/I0-001/014/374/981-0.jpeg_/la-jolla-music-society-presents-chamber-music-soci-81.jpeg","thumb":{"width":"48","url":"http://s2.evcdn.com/images/thumb/I0-001/014/374/981-0.jpeg_/la-jolla-music-society-presents-chamber-music-soci-81.jpeg","height":"48"},"height":"48"},"created":"2013-07-13 11:22:00","venue_id":"V0-001-001046075-0","tz_city":null,"stop_time":null,"venue_name":"Sherwood Auditorium at MCASD","venue_url":"http://sandiego.eventful.com/venues/sherwood-auditorium-at-mcasd-/V0-001-001046075-0?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"CA","postal_code":null,"going_count":null,"all_day":"0","latitude":"32.8446120","groups":null,"url":"http://sandiego.eventful.com/events/la-jolla-music-society-presents-chamber-music-socie-/E0-001-059121076-0?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-059121076-0","privacy":"1","city_name":"La Jolla","link_count":null,"longitude":"-117.2779420","country_name":"United States","country_abbr":"USA","region_name":"California","start_time":"2014-04-26 20:00:00","tz_id":null,"description":" La Jolla Music Society presents: Beethoven: Piano Quartet in E-flat Major, Op. 16; Martinu: Madrigals (3) for Violin and Viola, H 313; Faur: Quartet for Piano and Strings no 1 in C minor, Op. 15\n","modified":"2013-07-13 11:24:04","venue_display":"1","tz_country":null,"performers":{"performer":{"creator":"SPAHouston","linker":"evdb","name":"Chamber Music Society of Lincoln Center","url":"http://eventful.com/performers/chamber-music-society-of-lincoln-center-/P0-001-000144637-8?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"P0-001-000144637-8","short_bio":"one of 12 constituents of Lincoln Center for the Performing Arts, the largest performing arts complex in the world"}},"title":"La Jolla Music Society presents Chamber Music Society of Lincoln Center - Defining Voices","venue_address":"700 Prospect Street","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":{"small":{"width":"48","url":"http://s4.evcdn.com/images/small/I0-001/014/374/987-4.jpeg_/la-jolla-music-society-presents-chamber-music-soci-87.jpeg","height":"48"},"width":"48","caption":null,"medium":{"width":"128","url":"http://s4.evcdn.com/images/medium/I0-001/014/374/987-4.jpeg_/la-jolla-music-society-presents-chamber-music-soci-87.jpeg","height":"128"},"url":"http://s4.evcdn.com/images/small/I0-001/014/374/987-4.jpeg_/la-jolla-music-society-presents-chamber-music-soci-87.jpeg","thumb":{"width":"48","url":"http://s4.evcdn.com/images/thumb/I0-001/014/374/987-4.jpeg_/la-jolla-music-society-presents-chamber-music-soci-87.jpeg","height":"48"},"height":"48"},"created":"2013-07-13 11:24:04","venue_id":"V0-001-001046075-0","tz_city":null,"stop_time":null,"venue_name":"Sherwood Auditorium at MCASD","venue_url":"http://sandiego.eventful.com/venues/sherwood-auditorium-at-mcasd-/V0-001-001046075-0?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"CA","postal_code":null,"going_count":null,"all_day":"0","latitude":"32.8446120","groups":null,"url":"http://sandiego.eventful.com/events/la-jolla-music-society-presents-chamber-music-socie-/E0-001-059121035-3?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-059121035-3","privacy":"1","city_name":"La Jolla","link_count":null,"longitude":"-117.2779420","country_name":"United States","country_abbr":"USA","region_name":"California","start_time":"2014-02-08 20:00:00","tz_id":null,"description":" La Jolla Music Society presents: Debussy: Nocturnes, for 2 pianos; Debussy: Suite for Piano "Pour le piano"; Debussy: Jeux; Bizet: Jeux d'enfants, Op. 22; Gershwin: An American in Paris (Arr. for 2...\n","modified":"2013-07-13 11:19:24","venue_display":"1","tz_country":null,"performers":{"performer":{"creator":"SPAHouston","linker":"evdb","name":"Chamber Music Society of Lincoln Center","url":"http://eventful.com/performers/chamber-music-society-of-lincoln-center-/P0-001-000144637-8?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"P0-001-000144637-8","short_bio":"one of 12 constituents of Lincoln Center for the Performing Arts, the largest performing arts complex in the world"}},"title":"La Jolla Music Society presents Chamber Music Society of Lincoln Center - An American in Paris","venue_address":"700 Prospect Street","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":{"small":{"width":"48","url":"http://s2.evcdn.com/images/small/I0-001/014/374/973-1.jpeg_/la-jolla-music-society-presents-chamber-music-soci-73.jpeg","height":"48"},"width":"48","caption":null,"medium":{"width":"128","url":"http://s2.evcdn.com/images/medium/I0-001/014/374/973-1.jpeg_/la-jolla-music-society-presents-chamber-music-soci-73.jpeg","height":"128"},"url":"http://s2.evcdn.com/images/small/I0-001/014/374/973-1.jpeg_/la-jolla-music-society-presents-chamber-music-soci-73.jpeg","thumb":{"width":"48","url":"http://s2.evcdn.com/images/thumb/I0-001/014/374/973-1.jpeg_/la-jolla-music-society-presents-chamber-music-soci-73.jpeg","height":"48"},"height":"48"},"created":"2013-07-13 11:19:24","venue_id":"V0-001-001046075-0","tz_city":null,"stop_time":null,"venue_name":"Sherwood Auditorium at MCASD","venue_url":"http://sandiego.eventful.com/venues/sherwood-auditorium-at-mcasd-/V0-001-001046075-0?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"CA","postal_code":"92071","going_count":null,"all_day":"2","latitude":"32.8482","groups":null,"url":"http://sandiego.eventful.com/events/early-childhood-music-/E0-001-066111239-8?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-066111239-8","privacy":"1","city_name":"Santee","link_count":null,"longitude":"-116.992","country_name":"United States","country_abbr":"USA","region_name":"California","start_time":"2014-01-25 00:00:00","tz_id":null,"description":" Event Overview
Early Childhood Music, in Santee, CA, takes place January 25, 2014 and ends on March 01, 2014. This event will be located at Staump Music School.
","modified":"2014-01-23 19:43:12","venue_display":"1","tz_country":null,"performers":null,"title":"Early Childhood Music","venue_address":"9530 Pathway St. #201","geocode_type":"Zip Code Based GeoCodes","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2014-01-23 19:32:51","venue_id":"V0-001-007520469-4","tz_city":null,"stop_time":"2014-03-01 00:00:00","venue_name":"Staump Music School","venue_url":"http://sandiego.eventful.com/venues/staump-music-school-/V0-001-007520469-4?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"CA","postal_code":"92071","going_count":null,"all_day":"0","latitude":"32.8482","groups":null,"url":"http://sandiego.eventful.com/events/early-childhood-music-/E0-001-064510428-3@2014012609?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-064510428-3@2014012609","privacy":"1","city_name":"Santee","link_count":null,"longitude":"-116.992","country_name":"United States","country_abbr":"USA","region_name":"California","start_time":"2014-01-26 09:00:00","tz_id":null,"description":" ","modified":"2013-12-06 01:11:14","venue_display":"1","tz_country":null,"performers":null,"title":"Early Childhood Music","venue_address":"9530 Pathway St. #201","geocode_type":"Zip Code Based GeoCodes","tz_olson_path":null,"recur_string":"daily until March 1, 2014","calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2013-12-06 01:11:14","venue_id":"V0-001-007520469-4","tz_city":null,"stop_time":null,"venue_name":"Staump Music School","venue_url":"http://sandiego.eventful.com/venues/staump-music-school-/V0-001-007520469-4?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"CA","postal_code":"92093","going_count":null,"all_day":"0","latitude":"32.87785316904055","groups":null,"url":"http://sandiego.eventful.com/events/camera-lucida-presents-myriad-trio-ii-/E0-001-063056563-9?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-063056563-9","privacy":"1","city_name":"La Jolla","link_count":null,"longitude":"-117.234994776799","country_name":"United States","country_abbr":"USA","region_name":"California","start_time":"2014-06-10 19:30:00","tz_id":null,"description":" Camera Lucida; Myriad Trio; San Diego Symphony; UCSD Music Department presents: Program TBA\n","modified":"2014-01-05 01:35:08","venue_display":"1","tz_country":null,"performers":null,"title":"CAMERA LUCIDA Presents Myriad Trio II","venue_address":"9500 Gilman Drive","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":{"small":{"width":"48","url":"http://s2.evcdn.com/images/small/I0-001/014/953/237-3.jpeg_/camera-lucida-presents-myriad-trio-ii-37.jpeg","height":"48"},"width":"48","caption":null,"medium":{"width":"128","url":"http://s2.evcdn.com/images/medium/I0-001/014/953/237-3.jpeg_/camera-lucida-presents-myriad-trio-ii-37.jpeg","height":"128"},"url":"http://s2.evcdn.com/images/small/I0-001/014/953/237-3.jpeg_/camera-lucida-presents-myriad-trio-ii-37.jpeg","thumb":{"width":"48","url":"http://s2.evcdn.com/images/thumb/I0-001/014/953/237-3.jpeg_/camera-lucida-presents-myriad-trio-ii-37.jpeg","height":"48"},"height":"48"},"created":"2013-11-01 02:28:21","venue_id":"V0-001-006031574-7","tz_city":null,"stop_time":null,"venue_name":"Conrad Prebys Music Center","venue_url":"http://sandiego.eventful.com/venues/conrad-prebys-music-center-/V0-001-006031574-7?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"CA","postal_code":null,"going_count":null,"all_day":"0","latitude":"32.7744363","groups":null,"url":"http://sandiego.eventful.com/events/music-lent-/E0-001-060700804-8?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-060700804-8","privacy":"1","city_name":"San Diego","link_count":null,"longitude":"-117.1837880","country_name":"United States","country_abbr":"USA","region_name":"California","start_time":"2014-03-30 16:00:00","tz_id":null,"description":" Angelus Early Music Series presents: Program TBA\n","modified":"2013-09-29 03:16:16","venue_display":"1","tz_country":null,"performers":null,"title":"Music for Lent","venue_address":"Jenny Craig Pavilion","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":{"small":{"width":"48","url":"http://s3.evcdn.com/images/small/I0-001/014/610/090-6.jpeg_/music-lent-90.jpeg","height":"48"},"width":"48","caption":null,"medium":{"width":"128","url":"http://s3.evcdn.com/images/medium/I0-001/014/610/090-6.jpeg_/music-lent-90.jpeg","height":"128"},"url":"http://s3.evcdn.com/images/small/I0-001/014/610/090-6.jpeg_/music-lent-90.jpeg","thumb":{"width":"48","url":"http://s3.evcdn.com/images/thumb/I0-001/014/610/090-6.jpeg_/music-lent-90.jpeg","height":"48"},"height":"48"},"created":"2013-08-31 01:37:38","venue_id":"V0-001-006049978-4","tz_city":null,"stop_time":null,"venue_name":"University of San Diego","venue_url":"http://sandiego.eventful.com/venues/university-of-san-diego-/V0-001-006049978-4?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"CA","postal_code":"92093","going_count":null,"all_day":"0","latitude":"32.87785316904055","groups":null,"url":"http://sandiego.eventful.com/events/camera-lucida-mozart-brahms-/E0-001-063056554-1?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-063056554-1","privacy":"1","city_name":"La Jolla","link_count":null,"longitude":"-117.234994776799","country_name":"United States","country_abbr":"USA","region_name":"California","start_time":"2014-02-03 19:30:00","tz_id":null,"description":" Camera Lucida; San Diego Symphony; UCSD Music Department presents: Mozart: Piano Trio No. 4 in E major, K. 542; Clarke: Sonata for Viola/Cello and Piano; Brahms: Trio for Clarinet, Cello and Piano ...\n","modified":"2013-11-04 01:41:31","venue_display":"1","tz_country":null,"performers":null,"title":"CAMERA LUCIDA / Mozart, Brahms","venue_address":"9500 Gilman Drive","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":{"small":{"width":"48","url":"http://s2.evcdn.com/images/small/I0-001/014/953/233-7.jpeg_/camera-lucida-mozart-brahms-33.jpeg","height":"48"},"width":"48","caption":null,"medium":{"width":"128","url":"http://s2.evcdn.com/images/medium/I0-001/014/953/233-7.jpeg_/camera-lucida-mozart-brahms-33.jpeg","height":"128"},"url":"http://s2.evcdn.com/images/small/I0-001/014/953/233-7.jpeg_/camera-lucida-mozart-brahms-33.jpeg","thumb":{"width":"48","url":"http://s2.evcdn.com/images/thumb/I0-001/014/953/233-7.jpeg_/camera-lucida-mozart-brahms-33.jpeg","height":"48"},"height":"48"},"created":"2013-11-01 02:28:01","venue_id":"V0-001-006031574-7","tz_city":null,"stop_time":null,"venue_name":"Conrad Prebys Music Center","venue_url":"http://sandiego.eventful.com/venues/conrad-prebys-music-center-/V0-001-006031574-7?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"CA","postal_code":"92093","going_count":null,"all_day":"0","latitude":"32.87785316904055","groups":null,"url":"http://sandiego.eventful.com/events/camera-lucida-dvork-sibelius-/E0-001-063056559-6?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-063056559-6","privacy":"1","city_name":"La Jolla","link_count":null,"longitude":"-117.234994776799","country_name":"United States","country_abbr":"USA","region_name":"California","start_time":"2014-06-02 19:30:00","tz_id":null,"description":" Camera Lucida; San Diego Symphony; UCSD Music Department presents: Kodly: Serenade for Two Violins and Viola; Dvorak: Trio for Piano and Strings no 3 in F minor, Op. 65/B 130; Sibelius: Quartet fo...\n","modified":"2013-11-04 01:41:37","venue_display":"1","tz_country":null,"performers":null,"title":"CAMERA LUCIDA / Dvork, Sibelius","venue_address":"9500 Gilman Drive","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":{"small":{"width":"48","url":"http://s1.evcdn.com/images/small/I0-001/014/953/236-4.jpeg_/camera-lucida-dvork-sibelius-36.jpeg","height":"48"},"width":"48","caption":null,"medium":{"width":"128","url":"http://s1.evcdn.com/images/medium/I0-001/014/953/236-4.jpeg_/camera-lucida-dvork-sibelius-36.jpeg","height":"128"},"url":"http://s1.evcdn.com/images/small/I0-001/014/953/236-4.jpeg_/camera-lucida-dvork-sibelius-36.jpeg","thumb":{"width":"48","url":"http://s1.evcdn.com/images/thumb/I0-001/014/953/236-4.jpeg_/camera-lucida-dvork-sibelius-36.jpeg","height":"48"},"height":"48"},"created":"2013-11-01 02:28:18","venue_id":"V0-001-006031574-7","tz_city":null,"stop_time":null,"venue_name":"Conrad Prebys Music Center","venue_url":"http://sandiego.eventful.com/venues/conrad-prebys-music-center-/V0-001-006031574-7?utm_source=apis&utm_medium=apim&utm_campaign=apic"}]}}
diff --git a/assignments/session03/.cache/api.eventful.com,json,events,search,q=running&l=Seattle&app_key=test_key,44b43d8d27c899b633db930a9d0fb1d6 b/assignments/session03/.cache/api.eventful.com,json,events,search,q=running&l=Seattle&app_key=test_key,44b43d8d27c899b633db930a9d0fb1d6
new file mode 100644
index 00000000..85b3be38
--- /dev/null
+++ b/assignments/session03/.cache/api.eventful.com,json,events,search,q=running&l=Seattle&app_key=test_key,44b43d8d27c899b633db930a9d0fb1d6
@@ -0,0 +1,8 @@
+status: 200
+content-length: 11930
+content-location: http://api.eventful.com/json//events/search?q=running&l=Seattle&app_key=test_key
+server: lighttpd/1.4.28
+date: Wed, 29 Jan 2014 01:47:19 GMT
+content-type: text/javascript; charset=utf-8
+
+{"last_item":null,"total_items":"213","first_item":null,"page_number":"1","page_size":"10","page_items":null,"search_time":"0.036","page_count":"22","events":{"event":[{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":null,"going_count":null,"all_day":"2","latitude":"47.6064","groups":null,"url":"http://seattle.eventful.com/events/running-event-int-running-/E0-001-060455183-1?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-060455183-1","privacy":"1","city_name":"Seattle","link_count":null,"longitude":"-122.331","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-08-23 00:00:00","tz_id":null,"description":" ","modified":"2014-01-24 07:58:49","venue_display":"1","tz_country":null,"performers":null,"title":"Running Event - INT Running","venue_address":null,"geocode_type":"City Based GeoCodes","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2013-08-23 04:04:56","venue_id":"V0-001-007243812-0","tz_city":null,"stop_time":"2014-08-23 00:00:00","venue_name":"WA","venue_url":"http://seattle.eventful.com/venues/wa-/V0-001-007243812-0?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":"98208","going_count":null,"all_day":"0","latitude":"47.9015","groups":null,"url":"http://seattle.eventful.com/events/mill-creek-puddle-run-/E0-001-064399659-2?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-064399659-2","privacy":"1","city_name":"Everett","link_count":null,"longitude":"-122.184","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-02-02 08:30:00","tz_id":null,"description":" ","modified":"2013-12-19 13:55:35","venue_display":"1","tz_country":null,"performers":null,"title":"Mill Creek Puddle Run","venue_address":"13723 Puget Park Drive","geocode_type":"Zip Code Based GeoCodes","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2013-12-04 00:23:42","venue_id":"V0-001-007516927-6","tz_city":null,"stop_time":null,"venue_name":"Mill Creek Family YMCA","venue_url":"http://seattle.eventful.com/venues/mill-creek-family-ymca-/V0-001-007516927-6?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":"98103","going_count":null,"all_day":"2","latitude":"47.6798964","groups":null,"url":"http://seattle.eventful.com/events/superbowl-5k-runwalk-/E0-001-066202003-0?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-066202003-0","privacy":"1","city_name":"Seattle","link_count":null,"longitude":"-122.3281102","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-02-01 00:00:00","tz_id":null,"description":" ","modified":"2014-01-27 10:36:50","venue_display":"1","tz_country":null,"performers":null,"title":"SuperBowl 5k Run/Walk","venue_address":"7201 E Green Lake Drive N","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2014-01-27 10:36:50","venue_id":"V0-001-000402996-9","tz_city":null,"stop_time":"2014-02-01 00:00:00","venue_name":"Evans Pool","venue_url":"http://seattle.eventful.com/venues/evans-pool-/V0-001-000402996-9?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":"98421","going_count":null,"all_day":"2","latitude":"47.2363400","groups":null,"url":"http://seattle.eventful.com/events/color-run-tacoma-/E0-001-065225697-3?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-065225697-3","privacy":"1","city_name":"Tacoma","link_count":null,"longitude":"-122.4268340","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-08-10 00:00:00","tz_id":null,"description":" ","modified":"2014-01-05 01:29:57","venue_display":"1","tz_country":null,"performers":null,"title":"THE COLOR RUN TACOMA","venue_address":"2727 East D Street","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2013-12-27 12:24:00","venue_id":"V0-001-000144232-7","tz_city":null,"stop_time":"2014-08-10 00:00:00","venue_name":"Tacoma Dome","venue_url":"http://seattle.eventful.com/venues/tacoma-dome-/V0-001-000144232-7?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":"98373","going_count":null,"all_day":"0","latitude":"47.1402691","groups":null,"url":"http://seattle.eventful.com/events/rogers-reindeer-fun-run-/E0-001-064892349-4?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-064892349-4","privacy":"1","city_name":"Puyallup","link_count":null,"longitude":"-122.3091746","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-12-13 09:00:00","tz_id":null,"description":" ","modified":"2014-01-05 00:29:28","venue_display":"1","tz_country":null,"performers":null,"title":"Rogers Reindeer Fun Run","venue_address":"9010 128th Street E","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2013-12-15 12:17:53","venue_id":"V0-001-000549441-6","tz_city":null,"stop_time":"2014-12-13 00:00:00","venue_name":"Heritage Recreation Center","venue_url":"http://seattle.eventful.com/venues/heritage-recreation-center-/V0-001-000549441-6?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":"98103","going_count":null,"all_day":"2","latitude":"47.6468650","groups":null,"url":"http://seattle.eventful.com/events/emerald-city-run-/E0-001-061648024-4?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-061648024-4","privacy":"1","city_name":"Seattle","link_count":null,"longitude":"-122.3339155","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-05-25 00:00:00","tz_id":null,"description":" ","modified":"2014-01-04 13:20:49","venue_display":"1","tz_country":null,"performers":null,"title":"Emerald City Run","venue_address":"2101 N Northlake Way","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2013-09-24 13:12:40","venue_id":"V0-001-000256560-7","tz_city":null,"stop_time":"2014-05-25 00:00:00","venue_name":"Gas Works Park","venue_url":"http://seattle.eventful.com/venues/gas-works-park-/V0-001-000256560-7?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":"98106","going_count":null,"all_day":"2","latitude":"47.5498873","groups":null,"url":"http://seattle.eventful.com/events/seattle-run-series-revolution-run-2-3race-serie-/E0-001-064763538-9?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-064763538-9","privacy":"1","city_name":"Seattle","link_count":null,"longitude":"-122.2576880","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-02-23 00:00:00","tz_id":null,"description":" ","modified":"2014-01-09 01:42:49","venue_display":"1","tz_country":null,"performers":null,"title":"Seattle Run Series - Revolution Run (#2 of 3-Race Series)","venue_address":"5895 Lake Washington Blvd. S","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2013-12-12 02:27:25","venue_id":"V0-001-005947639-8","tz_city":null,"stop_time":"2014-02-23 00:00:00","venue_name":"Seward Park, Seattle, Shelter #2","venue_url":"http://seattle.eventful.com/venues/seward-park-seattle-shelter-2-/V0-001-005947639-8?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":"98106","going_count":null,"all_day":"2","latitude":"47.5498873","groups":null,"url":"http://seattle.eventful.com/events/seattle-run-series-evolution-run-3-3race-series-/E0-001-064763541-3?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-064763541-3","privacy":"1","city_name":"Seattle","link_count":null,"longitude":"-122.2576880","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-03-30 00:00:00","tz_id":null,"description":" ","modified":"2014-01-09 01:42:49","venue_display":"1","tz_country":null,"performers":null,"title":"Seattle Run Series - Evolution Run (#3 of 3-Race Series)","venue_address":"5895 Lake Washington Blvd. S","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2013-12-12 02:27:29","venue_id":"V0-001-005947639-8","tz_city":null,"stop_time":"2014-03-30 00:00:00","venue_name":"Seward Park, Seattle, Shelter #2","venue_url":"http://seattle.eventful.com/venues/seward-park-seattle-shelter-2-/V0-001-005947639-8?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":"98275","going_count":null,"all_day":"0","latitude":"47.8983820","groups":null,"url":"http://seattle.eventful.com/events/inspiring-hope-runwalk-2014-/E0-001-057746292-3?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-057746292-3","privacy":"1","city_name":"Mukilteo","link_count":null,"longitude":"-122.3003070","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-05-10 09:00:00","tz_id":null,"description":null,"modified":"2013-06-23 15:43:48","venue_display":"1","tz_country":null,"performers":null,"title":"Inspiring Hope Run/Walk 2014","venue_address":"10801 HARBOUR POINTE BLVD","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2013-05-27 01:10:56","venue_id":"V0-001-004573067-9","tz_city":null,"stop_time":null,"venue_name":"Kamiak High School","venue_url":"http://seattle.eventful.com/venues/kamiak-high-school-/V0-001-004573067-9?utm_source=apis&utm_medium=apim&utm_campaign=apic"},{"watching_count":null,"calendar_count":null,"comment_count":null,"region_abbr":"WA","postal_code":"98115","going_count":null,"all_day":"2","latitude":"47.6813531","groups":null,"url":"http://seattle.eventful.com/events/run-like-mother-seattle-wa-/E0-001-066165870-2?utm_source=apis&utm_medium=apim&utm_campaign=apic","id":"E0-001-066165870-2","privacy":"1","city_name":"Seattle","link_count":null,"longitude":"-122.2593355","country_name":"United States","country_abbr":"USA","region_name":"Washington","start_time":"2014-05-11 00:00:00","tz_id":null,"description":" ","modified":"2014-01-25 19:56:40","venue_display":"1","tz_country":null,"performers":null,"title":"Run Like A Mother - Seattle, WA","venue_address":"7400 Sand Point Way N.E.","geocode_type":"EVDB Geocoder","tz_olson_path":null,"recur_string":null,"calendars":null,"owner":"evdb","going":null,"country_abbr2":"US","image":null,"created":"2014-01-25 19:56:40","venue_id":"V0-001-000256403-3","tz_city":null,"stop_time":"2014-05-11 00:00:00","venue_name":"Warren G. Magnuson Park","venue_url":"http://seattle.eventful.com/venues/warren-g-magnuson-park-/V0-001-000256403-3?utm_source=apis&utm_medium=apim&utm_campaign=apic"}]}}
diff --git a/assignments/session03/eventful.py b/assignments/session03/eventful.py
new file mode 100644
index 00000000..5b98d618
--- /dev/null
+++ b/assignments/session03/eventful.py
@@ -0,0 +1,66 @@
+"""
+eventful
+
+A Python interface to the Eventful API.
+
+"""
+
+__author__ = "Edward O'Connor "
+__copyright__ = "Copyright 2005, 2006 Eventful Inc."
+__license__ = "MIT"
+
+import md5
+import urllib
+
+import httplib2
+import simplejson
+
+__all__ = ['APIError', 'API']
+
+class APIError(Exception):
+ pass
+
+class API:
+ def __init__(self, app_key, server='api.eventful.com', cache=None):
+ """Create a new Eventful API client instance.
+If you don't have an application key, you can request one:
+ http://api.eventful.com/keys/"""
+ self.app_key = app_key
+ self.server = server
+ self.http = httplib2.Http(cache)
+
+ def call(self, method, **args):
+ "Call the Eventful API's METHOD with ARGS."
+ # Build up the request
+ args['app_key'] = self.app_key
+ if hasattr(self, 'user_key'):
+ args['user'] = self.user
+ args['user_key'] = self.user_key
+ args = urllib.urlencode(args)
+ url = "http://%s/json/%s?%s" % (self.server, method, args)
+
+ # Make the request
+ response, content = self.http.request(url, "GET")
+
+ # Handle the response
+ status = int(response['status'])
+ if status == 200:
+ try:
+ return simplejson.loads(content)
+ except ValueError:
+ raise APIError("Unable to parse API response!")
+ elif status == 404:
+ raise APIError("Method not found: %s" % method)
+ else:
+ raise APIError("Non-200 HTTP response status: %s" % response['status'])
+
+ def login(self, user, password):
+ "Login to the Eventful API as USER with PASSWORD."
+ nonce = self.call('/users/login')['nonce']
+ response = md5.new(nonce + ':'
+ + md5.new(password).hexdigest()).hexdigest()
+ login = self.call('/users/login', user=user, nonce=nonce,
+ response=response)
+ self.user_key = login['user_key']
+ self.user = user
+ return user
diff --git a/assignments/session03/eventmap_mash.py b/assignments/session03/eventmap_mash.py
new file mode 100644
index 00000000..3b7fd840
--- /dev/null
+++ b/assignments/session03/eventmap_mash.py
@@ -0,0 +1,60 @@
+__author__ = 'brianschmitz'
+
+
+
+
+import eventful
+
+api = eventful.API('test_key', cache='.cache')
+# api.login('username', 'password')
+events = api.call('/events/search', q='running', l='Seattle', )
+
+for event in events['events']['event']:
+ print "%s at %s" % (event['title'], event['venue_name'],)
+ print event['start_time']
+ print event['description']
+
+import requests
+
+URL = 'https://www.google.com/search?pz=1&cf=all&ned=us&hl=en&tbm=nws&gl=us&as_q={query}&as_occt=any&as_drrb=b&as_mindate={month}%2F%{from_day}%2F{year}&as_maxdate={month}%2F{to_day}%2F{year}&tbs=cdr%3A1%2Ccd_min%3A3%2F1%2F13%2Ccd_max%3A3%2F2%2F13&as_nsrc=Gulf%20Times&authuser=0'
+
+
+def run(**params):
+ response = requests.get(URL.format(**params))
+ print response.content, response.status_code
+
+
+# run(query=event['description'], month=1, from_day=1, to_day=1, year=14)
+
+# -*- coding: utf-8 -*-
+import urllib
+import urllib2
+import json
+
+def main(event):
+ query = event
+ print bing_search(query, 'Web')
+ # print bing_search(query, 'Image')
+
+def bing_search(query, search_type):
+ #search_type: Web, Image, News, Video
+ key= 'fIXP2iI8QV2pPFpJBao3e5lfrMP8B27CtQ5c2UkKq3w'
+ query = urllib.quote(query)
+ # create credential for authentication
+ user_agent = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Trident/4.0; FDM; .NET CLR 2.0.50727; InfoPath.2; .NET CLR 1.1.4322)'
+ credentials = (':%s' % key).encode('base64')[:-1]
+ auth = 'Basic %s' % credentials
+ url = 'https://api.datamarket.azure.com/Data.ashx/Bing/Search/'+search_type+'?Query=%27'+query+'%27&$top=5&$format=json'
+ request = urllib2.Request(url)
+ request.add_header('Authorization', auth)
+ request.add_header('User-Agent', user_agent)
+ request_opener = urllib2.build_opener()
+ response = request_opener.open(request)
+ response_data = response.read()
+ json_result = json.loads(response_data)
+ result_list = json_result['d']['results']
+ print result_list
+ return result_list
+
+if __name__ == "__main__":
+ main(event['description'])
\ No newline at end of file
diff --git a/resources/session03/mashup.py b/resources/session03/mashup.py
index 5ebfc490..c10aba24 100644
--- a/resources/session03/mashup.py
+++ b/resources/session03/mashup.py
@@ -20,6 +20,7 @@ def fetch_search_results(
def parse_source(html, encoding='utf-8'):
+ html = open('craigslist_results.html', 'r')
parsed = BeautifulSoup(html, from_encoding=encoding)
return parsed
@@ -82,11 +83,20 @@ def add_walkscore(listing):
if __name__ == '__main__':
- html, encoding = fetch_search_results(
- minAsk=500, maxAsk=1000, bedrooms=2
- )
+
+ # html, encoding = fetch_search_results(
+ # minAsk=500, maxAsk=1000, bedrooms=2
+ #)
+ html = ''
+ encoding = 'utf-8'
+
doc = parse_source(html, encoding)
- for listing in extract_listings(doc):
- listing = add_address(listing)
- listing = add_walkscore(listing)
- pprint.pprint(listing)
+ listings = extract_listings(doc)
+
+ #for listings in listings
+ print listings
+ #for listing in extract_listings(doc):
+ # listing = add_address(listing)
+ # listing = add_walkscore(listing)
+ # pprint.pprint(listing)
+ print doc.prettify()
\ No newline at end of file
diff --git a/resources/session04/cgi/cgi-bin/cgi_1.py b/resources/session04/cgi/cgi-bin/cgi_1.py
index b969de64..27936f82 100755
--- a/resources/session04/cgi/cgi-bin/cgi_1.py
+++ b/resources/session04/cgi/cgi-bin/cgi_1.py
@@ -1,5 +1,11 @@
#!/usr/bin/python
import cgi
+import cgitb
+
+
+cgitb.enable
+
+
cgi.test()
diff --git a/resources/session04/cgi/cgi-bin/cgi_2.py b/resources/session04/cgi/cgi-bin/cgi_2.py
index eb6f2702..8b9744c5 100755
--- a/resources/session04/cgi/cgi-bin/cgi_2.py
+++ b/resources/session04/cgi/cgi-bin/cgi_2.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env/python
import cgi
import cgitb
cgitb.enable()
diff --git a/resources/session04/wsgi/bookapp.py b/resources/session04/wsgi/bookapp.py
index 809d0a0a..c2eeead5 100644
--- a/resources/session04/wsgi/bookapp.py
+++ b/resources/session04/wsgi/bookapp.py
@@ -5,19 +5,65 @@
DB = BookDB()
-def book(book_id):
- return "
a book with id %s
" % book_id
+def book(book_id):
+ page = """
+
{title}
+
+
Author
{author}
+
Publisher
{publisher}
+
ISBN
{isbn}
+
+Back to the list
+"""
+ book = DB.title_info(book_id)
+ if book is None:
+ raise NameError
+ return page.format(**book)
def books():
- return "