Skip to content

Commit

Permalink
Update update_peviitor.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cristiol committed Sep 5, 2024
1 parent 8086a81 commit cde81ce
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/update_peviitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
class UpdatePeViitor:

def __init__(self):
self.post_url = 'https://api.peviitor.ro/v5/add/'
self.post_url = 'https://api.laurentiumarian.ro/jobs/add/'
self.logo_url = 'https://api.peviitor.ro/v1/logo/add/'

self.post_header = {
Expand All @@ -27,7 +27,6 @@ def get_token(self):
token = requests.post(token_endpoint, json={
"email": 'cristiolteanu1892@gmail.com'
})

return token.json()['access']


Expand All @@ -36,13 +35,14 @@ def update_jobs(self, company, data_jobs: list):
# time sleep for SOLR indexing
time.sleep(0.2)

requests.post(self.post_url, headers=self.post_header, data=json.dumps(data_jobs))
res = requests.post(self.post_url, headers=self.post_header, data=json.dumps(data_jobs))
print(res.status_code)
print(json.dumps(data_jobs, indent=4))

def update_logo(self, id_company: str, logo_link: str):

data = json.dumps([{"id": id_company, "logo": logo_link}])
requests.post(self.logo_url, headers=self.logo_header, data=data)
#print(requests.post(self.logo_url, headers=self.logo_header, data=data))



0 comments on commit cde81ce

Please sign in to comment.