-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
31 lines (23 loc) · 911 Bytes
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import dotenv
import os
from notifier.types.config import get_config
from notifier.discord import DiscordNotifier
from notifier.board.linkedin import LinkedinJobBoard
def main():
dotenv.load_dotenv()
print(os.environ.get("TEST_ENV_VAR"))
cfg = get_config(dict(os.environ))
job_titles = ["Software Engineer Intern"]
discord_notifier = DiscordNotifier(cfg.discord_webhook_url)
linkedin_job_board = LinkedinJobBoard(cfg.linkedin_jsession_id, cfg.linkedin_li_at)
companies_seen = set()
posts = linkedin_job_board.get_postings(job_titles)
for post in posts:
company_id = post.companyId
if company_id in companies_seen:
print("Skipping because we already sent out a notification for this company")
else:
discord_notifier.send(post)
companies_seen.add(company_id)
if __name__ == "__main__":
main()