Shorten content field for very long Reddit search results
This commit is contained in:
		
							parent
							
								
									80813c3e05
								
							
						
					
					
						commit
						a8832574fa
					
				| @ -66,7 +66,10 @@ def response(resp): | |||||||
|             img_results.append(params) |             img_results.append(params) | ||||||
|         else: |         else: | ||||||
|             created = datetime.fromtimestamp(data['created_utc']) |             created = datetime.fromtimestamp(data['created_utc']) | ||||||
|             params['content'] = escape(data['selftext']) |             content = escape(data['selftext']) | ||||||
|  |             if len(content) > 500: | ||||||
|  |                 content = content[:500] + '...' | ||||||
|  |             params['content'] = content | ||||||
|             params['publishedDate'] = created |             params['publishedDate'] = created | ||||||
|             text_results.append(params) |             text_results.append(params) | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user