summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormsglm <msglm@techchud.xyz>2023-01-11 20:49:27 -0600
committermsglm <msglm@techchud.xyz>2023-01-11 20:49:27 -0600
commit466e5376d61f004169fce19c8e20d192d272b59e (patch)
tree8ea0a51014c3996b3d209d621ecedcdb0fe901e3 /src
parent40fc1eb64fb8da26544bd2e2b4855813ffb2f244 (diff)
downloadindeedwatcher-466e5376d61f004169fce19c8e20d192d272b59e.tar.gz
indeedwatcher-466e5376d61f004169fce19c8e20d192d272b59e.tar.bz2
indeedwatcher-466e5376d61f004169fce19c8e20d192d272b59e.zip
oops forgot arrays indexed at 0 for a moment
Diffstat (limited to 'src')
-rw-r--r--src/indeedwatcher.nim25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/indeedwatcher.nim b/src/indeedwatcher.nim
index 2e5ff87..0f86a18 100644
--- a/src/indeedwatcher.nim
+++ b/src/indeedwatcher.nim
@@ -18,7 +18,7 @@ let cachefileloc = getCacheDir() & "/indeedwatcher/listings.cache"
var cache = splitLines(readFile(cachefileloc))
#Webdriver
-let chromedriver = startProcess(chromedriverloc, "", ["--headless", "--disable-gpu"])
+let chromedriver = startProcess(chromedriverloc, "", ["--headless"])
sleep 5000
echo "connecting"
#TODO make the port configurable, some users may have something running here
@@ -39,42 +39,45 @@ proc terminate() {.noconv.} =
setControlCHook(terminate)
for feed in feeds:
- echo "now reading " & feed
- #Feednim
+ #Getting the listing URLs from the feeds
+ echo "now reading " & feed
+ sleep 1000
var rssFeedReply = getRSS(feed)
for entry in rssFeedReply.items:
- echo entry.link
- #Logging
-
+ #Sleep so indeed.com doesn't freak out
if counter > 7:
echo "resting for 7 seconds ..."
sleep 7000
counter = 0
+
+ #Don't even bother visiting it if its in the cache
var URL = entry.link
- let URLID = entry.link.split('&')[4]
+ let URLID = entry.link.split('&')[3]
+ echo URL
+ echo URLID
echo any(cache, proc (input: string): bool = input.contains(URLID))
if not any(cache, proc (input: string): bool = input.contains(URLID)):
session.navigate(URL)
counter = counter + 1
#HTML Parser
- var salaryInfoAndJobType: string
- var employer: string
let jobTitle = session.findElement(".jobsearch-JobInfoHeader-title").get().getText()
+ let fullDesc = session.findElement("#jobDescriptionText").get().getText()
+ var employer: string
try:
employer = session.findElement(".jobsearch-InlineCompanyRating-companyHeader").get().getText()
except UnpackDefect:
- salaryInfoAndJobType = "None Listed"
+ employer = "None Listed"
+ var salaryInfoAndJobType: string
try:
salaryInfoAndJobType = session.findelement("#salaryInfoAndJobType").get().gettext()
except UnpackDefect:
salaryInfoAndJobType = "None Listed"
- let fullDesc = session.findElement("#jobDescriptionText").get().getText()
#Job Value Scorer