Compare commits
3 Commits
2514fabd38
...
ae7ba458ce
Author | SHA1 | Date |
---|---|---|
pictuga | ae7ba458ce | |
pictuga | bd0bca69fc | |
pictuga | 8abd951d40 |
13
README.md
13
README.md
|
@ -264,8 +264,8 @@ output = morss.FeedFormat(rss, options, 'unicode') # formats final feed
|
|||
### 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
|
||||
cases" below is detailed how to pass those arguments to morss.
|
||||
may need to have a value (usually a string or a number). How to pass those
|
||||
arguments to morss is explained in Run above.
|
||||
|
||||
The list of arguments can be obtained by running `morss --help`
|
||||
|
||||
|
@ -343,8 +343,9 @@ To pass environment variables:
|
|||
|
||||
Generic:
|
||||
|
||||
- `DEBUG=1`: to have some feedback from the script
|
||||
execution. Useful for debugging.
|
||||
- `DEBUG=1`: to have some feedback from the script execution. Useful for
|
||||
debugging.
|
||||
- `IGNORE_SSL=1`: to ignore SSL certs when fetch feeds and articles
|
||||
- `DELAY` sets the browser cache delay, only for HTTP clients
|
||||
- `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:
|
||||
|
||||
- `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.
|
||||
- `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
|
||||
|
||||
|
|
|
@ -50,13 +50,8 @@ except NameError:
|
|||
basestring = unicode = str
|
||||
|
||||
|
||||
CACHE_SIZE = int(os.getenv('CACHE_SIZE', 10000)) # max number of items in cache (default: 10k items)
|
||||
CACHE_LIFESPAN = int(os.getenv('CACHE_LIFESPAN', 60*60)) # how often to auto-clear the cache (default: 1hr)
|
||||
|
||||
|
||||
# uncomment the lines below to ignore SSL certs
|
||||
#import ssl
|
||||
#ssl._create_default_https_context = ssl._create_unverified_context
|
||||
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)) # how often to auto-clear the cache (default: 1min)
|
||||
|
||||
|
||||
MIMETYPE = {
|
||||
|
@ -744,6 +739,11 @@ else:
|
|||
default_cache = CappedDict()
|
||||
|
||||
|
||||
if 'IGNORE_SSL' in os.environ:
|
||||
import ssl
|
||||
ssl._create_default_https_context = ssl._create_unverified_context
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
req = adv_get(sys.argv[1] if len(sys.argv) > 1 else 'https://morss.it')
|
||||
|
||||
|
|
Loading…
Reference in New Issue