| 
				
			 | 
			
			
				@@ -10,6 +10,7 @@ 
			 | 
		
	
		
			
			| 
				10
			 | 
			
				10
			 | 
			
			
				  @parse       url, title, content 
			 | 
		
	
		
			
			| 
				11
			 | 
			
				11
			 | 
			
			
				 """ 
			 | 
		
	
		
			
			| 
				12
			 | 
			
				12
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				
			 | 
			
				13
			 | 
			
			
				+from cgi import escape 
			 | 
		
	
		
			
			| 
				13
			 | 
			
				14
			 | 
			
			
				 from json import loads 
			 | 
		
	
		
			
			| 
				14
			 | 
			
				15
			 | 
			
			
				 from urllib import urlencode, unquote 
			 | 
		
	
		
			
			| 
				15
			 | 
			
				16
			 | 
			
			
				 import re 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -77,7 +78,7 @@ def response(resp): 
			 | 
		
	
		
			
			| 
				77
			 | 
			
				78
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				78
			 | 
			
				79
			 | 
			
			
				             # append result 
			 | 
		
	
		
			
			| 
				79
			 | 
			
				80
			 | 
			
			
				             results.append({'url': result['SourceUrl'], 
			 | 
		
	
		
			
			| 
				80
			 | 
			
				
			 | 
			
			
				-                            'title': result['Title'], 
			 | 
		
	
		
			
			| 
				
			 | 
			
				81
			 | 
			
			
				+                            'title': escape(result['Title']), 
			 | 
		
	
		
			
			| 
				81
			 | 
			
				82
			 | 
			
			
				                             'content': '', 
			 | 
		
	
		
			
			| 
				82
			 | 
			
				83
			 | 
			
			
				                             'img_src': img_url, 
			 | 
		
	
		
			
			| 
				83
			 | 
			
				84
			 | 
			
			
				                             'template': 'images.html'}) 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -89,8 +90,8 @@ def response(resp): 
			 | 
		
	
		
			
			| 
				89
			 | 
			
				90
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				90
			 | 
			
				91
			 | 
			
			
				             # append result 
			 | 
		
	
		
			
			| 
				91
			 | 
			
				92
			 | 
			
			
				             results.append({'url': result_url, 
			 | 
		
	
		
			
			| 
				92
			 | 
			
				
			 | 
			
			
				-                            'title': result_title, 
			 | 
		
	
		
			
			| 
				93
			 | 
			
				
			 | 
			
			
				-                            'content': result_content}) 
			 | 
		
	
		
			
			| 
				
			 | 
			
				93
			 | 
			
			
				+                            'title': escape(result_title), 
			 | 
		
	
		
			
			| 
				
			 | 
			
				94
			 | 
			
			
				+                            'content': escape(result_content)}) 
			 | 
		
	
		
			
			| 
				94
			 | 
			
				95
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				95
			 | 
			
				96
			 | 
			
			
				     # parse images 
			 | 
		
	
		
			
			| 
				96
			 | 
			
				97
			 | 
			
			
				     for result in json.get('Images', []): 
			 | 
		
	
	
		
			
			| 
				
			 | 
			
			
				@@ -99,7 +100,7 @@ def response(resp): 
			 | 
		
	
		
			
			| 
				99
			 | 
			
				100
			 | 
			
			
				  
			 | 
		
	
		
			
			| 
				100
			 | 
			
				101
			 | 
			
			
				         # append result 
			 | 
		
	
		
			
			| 
				101
			 | 
			
				102
			 | 
			
			
				         results.append({'url': result['SourceUrl'], 
			 | 
		
	
		
			
			| 
				102
			 | 
			
				
			 | 
			
			
				-                        'title': result['Title'], 
			 | 
		
	
		
			
			| 
				
			 | 
			
				103
			 | 
			
			
				+                        'title': escape(result['Title']), 
			 | 
		
	
		
			
			| 
				103
			 | 
			
				104
			 | 
			
			
				                         'content': '', 
			 | 
		
	
		
			
			| 
				104
			 | 
			
				105
			 | 
			
			
				                         'img_src': img_url, 
			 | 
		
	
		
			
			| 
				105
			 | 
			
				106
			 | 
			
			
				                         'template': 'images.html'}) 
			 |