Created
March 16, 2017 20:13
-
-
Save ramansah/ef6872cc815eeec1e83bef47d5566dd3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while True: | |
# Get all latest jobs | |
print '\nGetting Jobs at {} ...\n'.format( | |
datetime.now().strftime('%H:%M')) | |
jobs = client.provider_v2.search_jobs(job_query) | |
current_jobs = set() | |
# Iterate every job | |
for job in jobs: | |
# Generate a hash | |
uid = encode(job) | |
current_jobs.add(uid) | |
# Check if not viewed; new job | |
if uid not in prev_jobs: | |
prev_jobs.add(uid) | |
os.system('aplay {}'.format(NOTIFICATION_FILE)) | |
print ('Time : {}\nJob Title : {}\nURL : {}\n'.format( | |
datetime.now().strftime('%H:%M'), | |
job['title'], job['url'] | |
)) | |
webbrowser.open(url=job['url'], autoraise=True, new=2) | |
prev_jobs = current_jobs | |
# 1.5 minutes rest | |
sleep(90) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment