Add "al" (apparent limit) param with value
Removes element from rss *after* treatment, useful for slow json API
This commit is contained in:
		
							
								
								
									
										8
									
								
								morss.py
									
									
									
									
									
								
							
							
						
						
									
										8
									
								
								morss.py
									
									
									
									
									
								
							@@ -123,6 +123,9 @@ class ParseOptions:
 | 
				
			|||||||
		else:
 | 
							else:
 | 
				
			||||||
			return False
 | 
								return False
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						def __contains__(self, key):
 | 
				
			||||||
 | 
							return self.options.__contains__(key)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Cache:
 | 
					class Cache:
 | 
				
			||||||
	""" Light, error-prone caching system. """
 | 
						""" Light, error-prone caching system. """
 | 
				
			||||||
	def __init__(self, folder, key, persistent=False, dic=False):
 | 
						def __init__(self, folder, key, persistent=False, dic=False):
 | 
				
			||||||
@@ -587,6 +590,11 @@ def Gather(url, cachePath, options):
 | 
				
			|||||||
			if not options.proxy:
 | 
								if not options.proxy:
 | 
				
			||||||
				Fill(item, cache, url)
 | 
									Fill(item, cache, url)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if 'al' in options:
 | 
				
			||||||
 | 
								if i+1 > int(options.al):
 | 
				
			||||||
 | 
									item.remove()
 | 
				
			||||||
 | 
									return
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if item.desc and item.content:
 | 
							if item.desc and item.content:
 | 
				
			||||||
			if options.clip:
 | 
								if options.clip:
 | 
				
			||||||
				item.content = item.desc + "<br/><br/><center>* * *</center><br/><br/>" + item.content
 | 
									item.content = item.desc + "<br/><br/><center>* * *</center><br/><br/>" + item.content
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user