If you use Upwork and you’d love to get recommended job notifications on your OS X notification center, this is for you. Grab the RSS feed of the recommended jobs from your account and place it inside the URL variable.
To run the script, we need to install some required packages first:
1 2 3 4 |
pip install requests --upgrade pip install pync --upgrade pip install beautifulsoup4 --upgrade pip install lxml --upgrade |
Then save the following code as “upwork.py”
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import requests from bs4 import BeautifulSoup from pync import Notifier from urllib.parse import unquote URL = 'https://www.upwork.com/find-work-home/rss?securityToken=66da1df2fc9020ca1631a0b7775962a521e5761b14de30418e92c4ce67a89b28~6179f50' response = requests.get(URL) soup = BeautifulSoup(response.content, 'xml') items = soup.find_all('item') for job_posting in items: Notifier.notify(job_posting.title.text, open=unquote(job_posting.link.text)) |
Now you can manually run it or add it to cron job. Every time the script is executed, it would fetch all the recommended jobs for you and display in the notifications cenyer. You can afterwards click an item from the notification center to visit the actual job post.
One reply on “Upwork recommended jobs to OS X notifications center”
Need to export this if it is not included in .bash_profile
export CFLAGS=-Qunused-arguments
export CPPFLAGS=-Qunused-arguments
One more thing, If anyone is using Python 2.7 he has to change the line no 4
from urlparse import unquote (changed to urlib.parse in python 3)