diff --git a/app/app.py b/app/app.py index 0367059..03fd605 100644 --- a/app/app.py +++ b/app/app.py @@ -3,6 +3,10 @@ import requests import json import re +import os + + +app = Flask(__name__) def AELScore(job_title, job_description): count = 0 @@ -51,30 +55,44 @@ def clearanceCheck(job_description): def getAllJobs(user_ip, jobtitle, location): all_jobs = [] offset = 0 - guard_rail = 0 + iteration = 15 + user_agent = request.headers.get("User-Agent") + talent_publisher_key = os.environ["TALENT_PUBLISHER_KEY"] - while True: + while offset < 100: # Make the API call - talent = json.loads(requests.get(f'https://neuvoo.com/services/api-new/search?language=en&v=2&sort=relevance&ip={user_ip}&useragent=123asd&k={jobtitle}&l={location}&contenttype=all&format=json&publisher=92f7a67c&cpcfloor=1&subid=10101&jobdesc=1&country=us&radius=50&start={offset}').text) - + talent_query_string = ( + f"https://neuvoo.com/services/api-new/search?" + f"language=en" + f"&v=2" + f"&sort=relevance" + f"&ip={user_ip}" + f"&useragent={user_agent}" + f"&k={jobtitle}" + f"&l={location}" + f"&contenttype=all" + f"&format=json" + f"&publisher={talent_publisher_key}" + f"&cpcfloor=1" + f"&subid=10101" + f"&jobdesc=1" + f"&country=us" + f"&radius=50" + f"&start={offset}" + f"&limit={iteration}" + ) + talent = json.loads(requests.get(talent_query_string).text) # Add the results to the total all_jobs += talent['results'] # If offset would be higher than total results on the next call, then stop - if talent['totalresults'] <= (offset + 15): - break + if talent['totalresults'] <= (offset): + break # Add 15 to the offset to get the next n results, where 0 < n <= 15 - offset += 15 - - # Use a guard rail to make sure this loop doesn't fly off the track - guard_rail += 1 - if guard_rail == 100: - break + offset += iteration return all_jobs -app = Flask(__name__) - @app.route('/', methods = ['GET', 'POST']) def home(): #This if statement handles the search requests both from index and the search page @@ -119,7 +137,6 @@ def search(): # Need to include end user ip and end user's "useragent" user_ip = request.remote_addr - #talent = json.loads(requests.get(f'https://neuvoo.com/services/api-new/search?ip=1.1.1.1&useragent=123asd&k={jobtitle}&l={location}&contenttype=all&format=json&publisher=92f7a67c&cpcfloor=1&subid=10101&jobdesc=1&country=us&radius=50').text) try: # Error handling is based on the assumption that talent['results'] will # return an error because Talent.com will return a list for errors, not @@ -131,7 +148,6 @@ def search(): # Possibly out of scope for MVP jobtitle = "driver" location = "washington+dc" - #talent = json.loads(requests.get(f'https://neuvoo.com/services/api-new/search?ip=1.1.1.1&useragent=123asd&k={jobtitle}&l={location}&contenttype=all&format=json&publisher=92f7a67c&cpcfloor=1&subid=10101&jobdesc=1&country=us&radius=50').text) talent_jobs = getAllJobs(user_ip, jobtitle, location)#talent['results'] # Filter the dictionary @@ -165,4 +181,4 @@ def page_not_found(e): return render_template('404.html', error=e), 404 if __name__ == '__main__': - app.run(use_reloader=True, debug=True) + app.run(use_reloader=True, debug=False) diff --git a/app/static/css/bulma/bulma-fab-button.css b/app/static/css/bulma/bulma-fab-button.css new file mode 100644 index 0000000..bcd90e9 --- /dev/null +++ b/app/static/css/bulma/bulma-fab-button.css @@ -0,0 +1,41 @@ +.button.is-floating { + position: fixed; + width: 3.75rem; + height: 3.75rem; + right: 1.25rem; + bottom: 1.25rem; + border-radius: 50%; + text-align: center; + font-size: 1.5rem; + box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25); + z-index: 10; +} + +.button.is-floating.is-left { + left: 1.25rem !important; + bottom: 1.25rem !important; +} + +.button.is-floating.is-centered { + left: 50% !important; + bottom: 1.25rem !important; + transform: translateX(-50%) !important; +} + +.button.is-floating.is-right { + right: 1.25rem !important; + bottom: 1.25rem !important; +} + +.button.is-floating.is-large { + width: 4.6875rem !important; + height: 4.6875rem !important; + font-size: 1.875rem !important; +} + +.button.is-floating.is-small { + width: 2.8125rem !important; + height: 2.8125rem !important; + font-size: 1.125rem !important; +} +/*# sourceMappingURL=bulma-fab-button.css.map */ diff --git a/app/static/img/Actuent.jpg b/app/static/img/Actuent.jpg new file mode 100644 index 0000000..70cfe11 Binary files /dev/null and b/app/static/img/Actuent.jpg differ diff --git a/app/static/img/brooke-cagle-g1Kr4Ozfoac-unsplash.jpg b/app/static/img/brooke-cagle-g1Kr4Ozfoac-unsplash.jpg new file mode 100644 index 0000000..36bb561 Binary files /dev/null and b/app/static/img/brooke-cagle-g1Kr4Ozfoac-unsplash.jpg differ diff --git a/app/static/img/open_graph.jpg b/app/static/img/open_graph.jpg new file mode 100644 index 0000000..b7626ca Binary files /dev/null and b/app/static/img/open_graph.jpg differ diff --git a/app/static/img/open_graph.xcf b/app/static/img/open_graph.xcf new file mode 100644 index 0000000..603dc90 Binary files /dev/null and b/app/static/img/open_graph.xcf differ diff --git a/app/static/js/main.js b/app/static/js/main.js index ac70dac..576ae09 100644 --- a/app/static/js/main.js +++ b/app/static/js/main.js @@ -15,3 +15,31 @@ document.addEventListener('DOMContentLoaded', function() { } } }); + +// function actuent_favorite(a) { +// pageTitle=document.title; +// pageURL=document.location; +// try { +// // Internet Explorer solution +// eval("window.external.AddFa-vorite(pageURL, pageTitle)".replace(/-/g,'')); +// } +// catch (e) { +// try { +// // Mozilla Firefox solution +// window.sidebar.addPanel(pageTitle, pageURL, ""); +// } +// catch (e) { +// // Opera solution +// if (typeof(opera)=="object") { +// a.rel="sidebar"; +// a.title=pageTitle; +// a.url=pageURL; +// return true; +// } else { +// // The rest browsers (i.e Chrome, Safari) +// alert('Press ' + (navigator.userAgent.toLowerCase().indexOf('mac') != -1 ? 'Cmd' : 'Ctrl') + '+D to bookmark this page.'); +// } +// } +// } +// return false; +// } diff --git a/app/templates/_includes/head.html b/app/templates/_includes/head.html index 3b9cd4e..a7c27d9 100644 --- a/app/templates/_includes/head.html +++ b/app/templates/_includes/head.html @@ -4,10 +4,20 @@ + + + + + + + + + + diff --git a/app/templates/about.html b/app/templates/about.html index 343d1e0..2ee7680 100644 --- a/app/templates/about.html +++ b/app/templates/about.html @@ -10,35 +10,53 @@
Orton
- -"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras porta velit id augue convallis porta at vitae nisi."
+"Every time I would visit LinkedIn, I would see my friends + sharing posts about how frustrating it is that the supposedly + entry-level jobs they were filtering for would end up still + requiring 3-5 years experience. That's where the idea of + Actuent came about."
+— Orton (@ortonbabb)
Andrew
- -"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras porta velit id augue convallis porta at vitae nisi."
++ "I had a frustrating time sifting through 'entry level' job + listings that were anything but. Orton and I wished we had a + site that implemented a filter without the need to share + information or create an account and decided to make our own." +
+— Andrew (@AndrewHornstra)
Hosted on Heroku
-+ Hosted on + Heroku +
++ Jobs listings from + Talent.com +
++ Built with + Flask +
+We find all the jobs available and use natural language processing to filter out non-entry level jobs
++ We query Talent.com + use pattern matching to score the results based on the keywords that appear + in the title and job description. +
We return the results with links to the job post!
(User info description)
++ We don't collect any user data. + Anything you type here only ever exists in server logs for us. + Talent and Heroku are the only other entities that you will + interact with here. We don't have ads and don't seel any type + of data. How we make money is found on the + About page. +
{{job.description_preview}}
{% if job.AELScore > 0%} AEL +{{job.AELScore}}