-
Notifications
You must be signed in to change notification settings - Fork 2
Guide to patch Coldsweat to provide automatic feed fetch feature via a URL
Eventually, Coldsweat will have its own equivalent feature so this is a temporary hack, oblivious of user accounts (fetches anything and everything). As such, it also doesn't require user password before performing the fetch operation.
Anyway, prerequisites to this hack are:
- Install QColdsweat on your QNAP.
- Gain access to the files on your QNAP (e.g. SSH, sFTP and so on).
- Make yourself familiar with QColdsweat's folder structure.
Add the following to <application-folder>/coldsweat/coldsweat/frontend.py
:
@GET(r'^/feeds/fetch$')
def feed_fetch_all_now(self):
if config.web.fetch_override:
self.fetch_all_feeds()
return self.entry_list()
else:
raise HTTPForbidden('This feature has not been allowed')
Note: keep the 4-space indentation. Otherwise, python will complain.
There are two array definitions in <application-folder>/coldsweat/coldsweat/config.py
:
DEFAULTS = {
'min_interval' : '900',
'max_errors' : '50',
'max_history' : '7',
'timeout' : '10',
'processes' : '4',
'level' : 'INFO',
'filename' : '',
'static_url' : '',
'load' : ''
}
converters = {
'min_interval' : parser.getint,
'max_errors' : parser.getint,
'max_history' : parser.getint,
'timeout' : parser.getint,
'processes' : parser.getint,
}
Add this to the DEFAULTS array:
'fetch_override' : 'no',
Add this to the CONVERTERS array:
'fetch_override' : parser.getboolean,
Add the following to <data-folder>/config
and into the [web]
section:
; If enabled, all feeds will be re-fetched when 'http://<host>:<port>/feeds/fetch' is called, regardless of 'min_interval'.
fetch_override: yes
Create a bookmarklet pointing to http://<host-or-ip-address-of-your-qnap>:3333/feeds/fetch
in your browser. Once you use it, Coldsweat will re-fetch all feeds and then redirect you to the index page (where you can login or browse through the new articles).
Restart the QPKG :). Equivalent to disable/enable operations in your App Center.