Example #1
0
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
Example #2
0
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
Example #3
0
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
Example #4
0
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
Example #5
0
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