Compare commits
No commits in common. "ae7ba458ce41c094978d7f1f4415dc14171f89df" and "2514fabd3811311f2c243fd4736da5178d90b29a" have entirely different histories.
ae7ba458ce
...
2514fabd38
13
README.md
13
README.md
|
@ -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). How to pass those
|
may need to have a value (usually a string or a number). In the different "Use
|
||||||
arguments to morss is explained in Run above.
|
cases" below is detailed how to pass those arguments to morss.
|
||||||
|
|
||||||
The list of arguments can be obtained by running `morss --help`
|
The list of arguments can be obtained by running `morss --help`
|
||||||
|
|
||||||
|
@ -343,9 +343,8 @@ To pass environment variables:
|
||||||
|
|
||||||
Generic:
|
Generic:
|
||||||
|
|
||||||
- `DEBUG=1`: to have some feedback from the script execution. Useful for
|
- `DEBUG=1`: to have some feedback from the script
|
||||||
debugging.
|
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
|
- `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
|
||||||
|
|
||||||
|
@ -377,10 +376,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 1k
|
be deleted but the cache might be temporarily bigger than that). Defaults to 10k
|
||||||
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 1min.
|
the number of items set in `CACHE_SIZE`). Defaults to 1hr.
|
||||||
|
|
||||||
### Content matching
|
### Content matching
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,13 @@ except NameError:
|
||||||
basestring = unicode = str
|
basestring = unicode = str
|
||||||
|
|
||||||
|
|
||||||
CACHE_SIZE = int(os.getenv('CACHE_SIZE', 1000)) # max number of items in cache (default: 1k items)
|
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)) # how often to auto-clear the cache (default: 1min)
|
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
|
||||||
|
|
||||||
|
|
||||||
MIMETYPE = {
|
MIMETYPE = {
|
||||||
|
@ -739,11 +744,6 @@ 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')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue