summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/indeedwatcher.nim21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/indeedwatcher.nim b/src/indeedwatcher.nim
index c1946dc..69c0071 100644
--- a/src/indeedwatcher.nim
+++ b/src/indeedwatcher.nim
@@ -30,10 +30,6 @@ if not fileExists(getCacheDir() & "/indeedwatcher/config.toml"):
writeFile(getCacheDir() & "/indeedwatcher/listings.cache", "")
-
-
-#TODO make this create folders and files for this automatically upon first start up
-
#Reading the config file
let config = parsetoml.parseFile(getConfigDir() & "/indeedwatcher/config.toml")
@@ -74,17 +70,13 @@ setControlCHook(terminate)
for feed in feeds:
#Getting the listing URLs from the feeds
- echo "now reading " & feed
var rssFeedReply: RSS
- for attempt in countup(0,5):
- try:
- rssFeedReply = getRSS(feed)
- except:
- if attempt < 5 - 1:
- continue
- else:
- raise
- break
+ #TODO implement a retry-on-fail system
+ try:
+ echo "now reading " & feed
+ rssFeedReply = getRSS(feed)
+ except:
+ raise
for entry in rssFeedReply.items:
@@ -98,6 +90,7 @@ for feed in feeds:
var URL = entry.link
let URLID = entry.link.split('&')[3]
if not any(cache, proc (input: string): bool = input.contains(URLID)):
+ echo "Telling chromium to navigate to " & URL
session.navigate(URL)
counter = counter + 1