#! /usr/bin/python

import json
jsonResponseFile = open('response.txt', 'r')
menu = json.load(jsonResponseFile)
data = menu['response']['data']

days = ('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday')

def displayMenu(restaurant, foodlist):
	if foodlist and 'Menu' in foodlist:
		print(restaurant + ':')
		print
		print
		for day in days:
			if day in foodlist['Menu'].keys():
				print('    ' + day + ':')
				print
				for meal, itemlist in foodlist['Menu'][day].iteritems():
					print('        ' + meal + ':')
					if type(itemlist['Items']['result']) == list:
						for item in itemlist['Items']['result']:
							print('        ' + item)
					else:
						print('        ' + itemlist['Items']['result'])
					print
				print

print
print('This menu is valid from ' + data['Start'] + ' to ' + data['End'] + '.')
print
print
# print json.dumps(data, indent=1)

for restaurant, foodlist in data['Restaurants'].iteritems():
	displayMenu(restaurant, foodlist)

@@ -1,11 +1,10 @@
 #!
- 
 /usr/bin
@@ -8,16 +8,19 @@
 bin/
+env 
 python%0A
-%0A
 impo
@@ -30,207 +30,49 @@
 json
-%0AjsonResponseFile = open('response.txt', 'r')%0Amenu = json.load(jsonResponseFile)%0Adata = menu%5B'response'%5D%5B'data'%5D%0A%0Adays = ('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday')
+, os, requests%0Afrom awsauth import S3Auth
 %0A%0Ade
@@ -187,16 +187,104 @@
 %09%09print%0A
+%09%09days = ('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday')%0A
 %09%09for da
@@ -690,141 +690,283 @@
 nt%0A%0A
-print%0Aprint('This menu is valid from ' + data%5B'Start'%5D + ' to ' + data%5B'End'%5D + '.')%0Aprint%0Aprint%0A# print json.dumps(data, indent=1)%0A%0A
+if __name__ == %22__main__%22:%0A%09ACCESS_KEY = os.environ.get('AWS_ACCESS_KEY_ID')%0A%09SECRET_KEY = os.environ.get('AWS_SECRET_ACCESS_KEY')%0A%09r = requests.get('http://s3.amazonaws.com/uwfoodmenu/response.txt', auth=S3Auth(ACCESS_KEY, SECRET_KEY))%0A%09menu = r.json()%5B'response'%5D%5B'data'%5D%0A%09
 for 
@@ -989,20 +989,20 @@
 list in 
-data
+menu
 %5B'Restau
@@ -1022,16 +1022,17 @@
 tems():%0A
+%09
 %09display
@@ -1058,8 +1058,145 @@
 odlist)%0A
+%09print%0A%09print('This menu is valid from ' + menu%5B'Start'%5D + ' to ' + menu%5B'End'%5D + '.')%0A%09print%0A%09print%0A%09# print json.dumps(menu, indent=4)%0A

Update parseMenu.py to use data from Amazon S3, refactoring of methods/main.