Compare commits

..

3 Commits

2 changed files with 14 additions and 13 deletions

View File

@ -264,8 +264,8 @@ output = morss.FeedFormat(rss, options, 'unicode') # formats final feed
### Arguments ### Arguments
morss accepts some arguments, to lightly alter the output of morss. Arguments morss accepts some arguments, to lightly alter the output of morss. Arguments
may need to have a value (usually a string or a number). In the different "Use may need to have a value (usually a string or a number). How to pass those
cases" below is detailed how to pass those arguments to morss. arguments to morss is explained in Run above.
The list of arguments can be obtained by running `morss --help` The list of arguments can be obtained by running `morss --help`
@ -343,8 +343,9 @@ To pass environment variables:
Generic: Generic:
- `DEBUG=1`: to have some feedback from the script - `DEBUG=1`: to have some feedback from the script execution. Useful for
execution. Useful for debugging. debugging.
- `IGNORE_SSL=1`: to ignore SSL certs when fetch feeds and articles
- `DELAY` sets the browser cache delay, only for HTTP clients - `DELAY` sets the browser cache delay, only for HTTP clients
- `TIMEOUT` sets the HTTP timeout when fetching rss feeds and articles - `TIMEOUT` sets the HTTP timeout when fetching rss feeds and articles
@ -376,10 +377,10 @@ environment variables: `MYSQL_USER`, `MYSQL_PWD`, `MYSQL_DB`, `MYSQL_HOST`
To limit the size of the cache: To limit the size of the cache:
- `CACHE_SIZE` sets the target number of items in the cache (further items will - `CACHE_SIZE` sets the target number of items in the cache (further items will
be deleted but the cache might be temporarily bigger than that). Defaults to 10k be deleted but the cache might be temporarily bigger than that). Defaults to 1k
entries. entries.
- `CACHE_LIFESPAN` sets how often the cache must be trimmed (i.e. cut down to - `CACHE_LIFESPAN` sets how often the cache must be trimmed (i.e. cut down to
the number of items set in `CACHE_SIZE`). Defaults to 1hr. the number of items set in `CACHE_SIZE`). Defaults to 1min.
### Content matching ### Content matching

View File

@ -50,13 +50,8 @@ except NameError:
basestring = unicode = str basestring = unicode = str
CACHE_SIZE = int(os.getenv('CACHE_SIZE', 10000)) # max number of items in cache (default: 10k items) CACHE_SIZE = int(os.getenv('CACHE_SIZE', 1000)) # max number of items in cache (default: 1k items)
CACHE_LIFESPAN = int(os.getenv('CACHE_LIFESPAN', 60*60)) # how often to auto-clear the cache (default: 1hr) CACHE_LIFESPAN = int(os.getenv('CACHE_LIFESPAN', 60)) # how often to auto-clear the cache (default: 1min)
# uncomment the lines below to ignore SSL certs
#import ssl
#ssl._create_default_https_context = ssl._create_unverified_context
MIMETYPE = { MIMETYPE = {
@ -744,6 +739,11 @@ else:
default_cache = CappedDict() default_cache = CappedDict()
if 'IGNORE_SSL' in os.environ:
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
if __name__ == '__main__': if __name__ == '__main__':
req = adv_get(sys.argv[1] if len(sys.argv) > 1 else 'https://morss.it') req = adv_get(sys.argv[1] if len(sys.argv) > 1 else 'https://morss.it')