-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathjob_tracker.py
More file actions
38 lines (27 loc) · 972 Bytes
/
Copy pathjob_tracker.py
File metadata and controls
38 lines (27 loc) · 972 Bytes
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
32
33
34
35
36
37
38
import requests
import json
from send_email import send_email
URL = "https://remoteok.io/api"
keys = ['date', 'company', 'position', 'tags', 'location', 'url']
wanted_tags = ["python"] # remote, javascript, backend, mobile, ...
def get_jobs():
resp = requests.get(URL)
job_results = resp.json()
jobs = []
for job_res in job_results:
# take only the specified keys
job = {k: v for k, v in job_res.items() if k in keys}
if job:
tags = job.get('tags')
tags = {tag.lower() for tag in tags}
if tags.intersection(wanted_tags):
jobs.append(job)
return jobs
if __name__ == '__main__':
python_jobs = get_jobs()
if python_jobs:
message = "Subject: Remote Python Jobs!\n\n"
message += "Found some cool Python jobs!\n\n"
for job in python_jobs:
message += f"{json.dumps(job)}\n\n"
send_email(message)