summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/indeedwatcher.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/indeedwatcher.nim b/src/indeedwatcher.nim
index 7419321..645d59e 100644
--- a/src/indeedwatcher.nim
+++ b/src/indeedwatcher.nim
@@ -40,7 +40,7 @@ let outdir = config["outdir"].getStr()
##Cache section of config
let chromedriverloc = config["chromedriver"].getStr()
let cachefileloc = getCacheDir() & "/indeedwatcher/listings.cache"
-var cache = splitLines(readFile(cachefileloc))
+var cache: seq[string]
##Filtering section of config
let titleblacklist = config["blacklist"]["title"].getElems().mapIt(it.getStr())
@@ -68,6 +68,8 @@ proc terminate() {.noconv.} =
setControlCHook(terminate)
for feed in feeds:
+
+ cache = splitLines(readFile(cachefileloc))
#Getting the listing URLs from the feeds
var rssFeedReply: RSS
@@ -140,8 +142,8 @@ for feed in feeds:
echo "Trigger was hit, discarding " & URL
else:
echo URL & " was in cache, discarding"
+ writeFile(cachefileloc, cache.join("\n"))
session.close()
terminate(chromedriver)
-writeFile(cachefileloc, cache.join("\n"))