def updateBase(): print "updateBase" WriteOnly.objects.all().delete() results = City.job_query("Front End") for result in results: WriteOnly.objects.create( num_jobs = result['numJobs'], city_name = result['name'], stateName = result['stateName'], latitude = result['latitude'], longitude = result['longitude'], job_title = "Front End", created_at = datetime.now() ) results = City.job_query("Back End") for result in results: WriteOnly.objects.create( num_jobs = result['numJobs'], city_name = result['name'], stateName = result['stateName'], latitude = result['latitude'], longitude = result['longitude'], job_title = "Back End", created_at = datetime.now() ) results = City.job_query("Full Stack") for result in results: WriteOnly.objects.create( num_jobs = result['numJobs'], city_name = result['name'], stateName = result['stateName'], latitude = result['latitude'], longitude = result['longitude'], job_title = "Full Stack", created_at = datetime.now() ) print '----------1-----------' results = python_crawler.customCrawler() print results print '----------2-----------' for result in results: newSalary = aveAmount(result['salary']) d = DiceJobs.objects.create( title = result['title'], skills = result['skills'], salary = newSalary, location = result['location'], posted = result['posted'], created_at = datetime.now(), ) print d return True
def updateBase(): print "updateBase" WriteOnly.objects.all().delete() results = City.job_query("Front End") for result in results: WriteOnly.objects.create( num_jobs=result["numJobs"], city_name=result["name"], state=result["stateName"], latitude=result["latitude"], longitude=result["longitude"], job_title="Front End", created_at=datetime.now(), ) results = City.job_query("Back End") for result in results: WriteOnly.objects.create( num_jobs=result["numJobs"], city_name=result["name"], state=result["stateName"], latitude=result["latitude"], longitude=result["longitude"], job_title="Back End", created_at=datetime.now(), ) results = City.job_query("Full Stack") for result in results: WriteOnly.objects.create( num_jobs=result["numJobs"], city_name=result["name"], state=result["stateName"], latitude=result["latitude"], longitude=result["longitude"], job_title="Full Stack", created_at=datetime.now(), ) results = python_crawler.customCrawler() for result in results: newSalary = aveAmount(result["salary"]) d = DiceJobs.objects.create( title=result["title"], skills=result["skills"], salary=newSalary, location=result["location"], posted=result["posted"], created_at=datetime.now(), ) print d return True
def updateBase(): print "updateBase" WriteOnly.objects.all().delete() results = City.job_query("Front End") for result in results: WriteOnly.objects.create(num_jobs=result['numJobs'], city_name=result['name'], stateName=result['stateName'], latitude=result['latitude'], longitude=result['longitude'], job_title="Front End", created_at=datetime.now()) results = City.job_query("Back End") for result in results: WriteOnly.objects.create(num_jobs=result['numJobs'], city_name=result['name'], stateName=result['stateName'], latitude=result['latitude'], longitude=result['longitude'], job_title="Back End", created_at=datetime.now()) results = City.job_query("Full Stack") for result in results: WriteOnly.objects.create(num_jobs=result['numJobs'], city_name=result['name'], stateName=result['stateName'], latitude=result['latitude'], longitude=result['longitude'], job_title="Full Stack", created_at=datetime.now()) print '----------1-----------' results = python_crawler.customCrawler() print results print '----------2-----------' for result in results: newSalary = aveAmount(result['salary']) d = DiceJobs.objects.create( title=result['title'], skills=result['skills'], salary=newSalary, location=result['location'], posted=result['posted'], created_at=datetime.now(), ) print d return True
def updateBase(): print "updateBase" WriteOnly.objects.all().delete() results = City.job_query("Front End") for result in results: WriteOnly.objects.create( num_jobs = result['numJobs'], city_name = result['name'], stateName = result['stateName'], stateAbbreviation = result['stateAbbreviation'], latitude = result['latitude'], longitude = result['longitude'], job_title = "Front End", created_at = datetime.now() ) print "Added Front end results" results = City.job_query("Back End") for result in results: WriteOnly.objects.create( num_jobs = result['numJobs'], city_name = result['name'], stateName = result['stateName'], stateAbbreviation = result['stateAbbreviation'], latitude = result['latitude'], longitude = result['longitude'], job_title = "Back End", created_at = datetime.now() ) print "Added Backend results" results = City.job_query("Full Stack") for result in results: WriteOnly.objects.create( num_jobs = result['numJobs'], city_name = result['name'], stateName = result['stateName'], stateAbbreviation = result['stateAbbreviation'], latitude = result['latitude'], longitude = result['longitude'], job_title = "Full Stack", created_at = datetime.now() ) print "added fullstack" return True
def updateBase(): print "updateBase" WriteOnly.objects.all().delete() results = City.job_query("Front End") for result in results: WriteOnly.objects.create(num_jobs=result['numJobs'], city_name=result['name'], stateName=result['stateName'], stateAbbreviation=result['stateAbbreviation'], latitude=result['latitude'], longitude=result['longitude'], job_title="Front End", created_at=datetime.now()) print "Added Front end results" results = City.job_query("Back End") for result in results: WriteOnly.objects.create(num_jobs=result['numJobs'], city_name=result['name'], stateName=result['stateName'], stateAbbreviation=result['stateAbbreviation'], latitude=result['latitude'], longitude=result['longitude'], job_title="Back End", created_at=datetime.now()) print "Added Backend results" results = City.job_query("Full Stack") for result in results: WriteOnly.objects.create(num_jobs=result['numJobs'], city_name=result['name'], stateName=result['stateName'], stateAbbreviation=result['stateAbbreviation'], latitude=result['latitude'], longitude=result['longitude'], job_title="Full Stack", created_at=datetime.now()) print "added fullstack" return True