ArchiMathur commited on
Commit
637679a
·
verified ·
1 Parent(s): 3289837

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -0
app.py CHANGED
@@ -8,6 +8,7 @@ import pickle
8
  import sklearn
9
  from datasets import load_dataset
10
  import joblib
 
11
 
12
 
13
  # Read the data
@@ -189,8 +190,31 @@ demo = gr.Interface(
189
  description="Members: Derrick Lim Kin Yeap 74597, Jason Jong Sheng Tat 75125, Jason Ng Yong Xing 75127, Muhamad Hazrie Bin Suhkery 73555 "
190
  )
191
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
192
  # Main execution
193
  if __name__ == "__main__":
 
 
 
 
 
 
 
 
 
194
  demo.launch(share=True)
195
 
196
 
 
8
  import sklearn
9
  from datasets import load_dataset
10
  import joblib
11
+ import requests
12
 
13
 
14
  # Read the data
 
190
  description="Members: Derrick Lim Kin Yeap 74597, Jason Jong Sheng Tat 75125, Jason Ng Yong Xing 75127, Muhamad Hazrie Bin Suhkery 73555 "
191
  )
192
 
193
+ url = "https://jobs-api14.p.rapidapi.com/v2/list"
194
+ querystring = {
195
+ "query":"Web Developer",
196
+ "location":"India",
197
+ "autoTranslateLocation":"false",
198
+ "remoteOnly":"false",
199
+ "employmentTypes":"fulltime;parttime;intern;contractor"
200
+ }
201
+ headers = {
202
+ "x-rapidapi-key": "714f5a2539msh798d996c3243876p19c71ajsnfcd7ce481cb9",
203
+ "x-rapidapi-host": "jobs-api14.p.rapidapi.com"
204
+ }
205
+
206
+
207
  # Main execution
208
  if __name__ == "__main__":
209
+ # Fetch job listings before launching the app
210
+ try:
211
+ response = requests.get(url, headers=headers, params=querystring)
212
+ job_listings = response.json()
213
+ print("Job Listings Retrieved Successfully")
214
+ # You could potentially store or process job_listings here
215
+ except requests.RequestException as e:
216
+ print(f"Error fetching job listings: {e}")
217
+
218
  demo.launch(share=True)
219
 
220