-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from Jigar3/master
Added a script in python to print all jobs using github jobs api
- Loading branch information
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import requests, json | ||
from bs4 import BeautifulSoup | ||
|
||
print("Enter Job Description") | ||
jobDes = raw_input() | ||
|
||
print("Enter the Location") | ||
location = raw_input() | ||
|
||
obj = requests.get("https://jobs.github.com/positions.json?description="+jobDes+"&location="+location) | ||
|
||
jsonObj = json.loads(obj.content) | ||
|
||
if (jsonObj): | ||
j=1 | ||
for i in jsonObj: | ||
print("Job " + str(j) + " ==>\n") | ||
print("Title: " + i['title'] + "\n") | ||
print("Location: " + i['location'] + "\n") | ||
print("Type: " + i["type"] + "\n") | ||
soup1 = BeautifulSoup(i['description'], "lxml") | ||
print("Description: " + soup1.get_text() + "\n") | ||
soup2 = BeautifulSoup(i['how_to_apply'], "lxml") | ||
print("How to Apply: " + soup2.get_text() + "\n") | ||
print("Company: " + i["company"] + "\n") | ||
print("Company Website: " + i["company_url"] + "\n") | ||
j+=1 | ||
print("---------------------------------------------------------------------") | ||
else: | ||
print("No Jobs Found") |