REMOTEOK_API = "https://remoteok.com/api"
REMOTEOK_DATETIME = "%Y-%m-%dT%H:%M:%S"
NAAS_DATETIME = "%Y-%m-%d %H:%M:%S"
def get_jobs(remoteok_url, categories):
'User-Agent': 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36',
url = remoteok_url + f"?tag={tag}"
res = requests.get(url, headers=headers)
except requests.HTTPError as e:
for idx, job in enumerate(job_details):
date = job['date'].split('+')[0]
publication_time = datetime.strptime(date, REMOTEOK_DATETIME).timestamp()
required_time = time.time() + date_from* 24 * 60 * 60 ### time in seconds
if publication_time >= required_time:
df.loc[index, 'URL'] = job.get('url')
df.loc[index, 'TITLE'] = job.get('position')
df.loc[index, 'COMPANY'] = job.get('company')
df.loc[index, 'TAGS'] = ", ".join(job.get('tags'))
df.loc[index, 'LOCATION'] = job.get('location')
df.loc[index, 'PUBLICATION_DATE'] = datetime.fromtimestamp(publication_time).strftime(NAAS_DATETIME)
df = df.sort_values(by='PUBLICATION_DATE', ascending=False)
df_jobs = get_jobs(REMOTEOK_API, categories)