Skip to content

Commit

Permalink
Merge pull request #13 from Actuent/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ortonbabb authored Aug 9, 2021
2 parents 721c12e + f6ed90e commit ab14c6b
Show file tree
Hide file tree
Showing 15 changed files with 192 additions and 51 deletions.
50 changes: 33 additions & 17 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
import requests
import json
import re
import os


app = Flask(__name__)

def AELScore(job_title, job_description):
count = 0
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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)
41 changes: 41 additions & 0 deletions app/static/css/bulma/bulma-fab-button.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added app/static/img/Actuent.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/img/open_graph.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/static/img/open_graph.xcf
Binary file not shown.
28 changes: 28 additions & 0 deletions app/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
// }
10 changes: 10 additions & 0 deletions app/templates/_includes/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,20 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="">
<meta property="og:title" content="Actuent | {{page_name}}" />
<meta property="og:type" content="website" />
<meta property="og:image" content="{{ url_for('static', filename= 'img/open_graph.jpg') }}" />
<meta property="og:url" content="http://www.actuent.io" />
<link rel="stylesheet" href="{{ url_for('static', filename= 'css/bulma/bulma.min.css') }}">
<meta property="og:description" content="Actuent is niche job board dedicated to students and recent college graduates who want find entry level jobs that are true to the name." />
<link rel="stylesheet" href="{{ url_for('static', filename= 'css/bulma/bulma-tooltip.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename= 'css/bulma/bulma-fab-button.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename= 'css/pagination.css') }}">
<link rel="stylesheet" href="{{ url_for('static', filename= 'css/search-box/search-box.css') }}">
<link rel="icon" href="favicon.ico">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<script src="{{ url_for('static', filename= 'js/main.js') }}"></script>
</head>
40 changes: 29 additions & 11 deletions app/templates/about.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,53 @@
<div class="hero-body">
<div class="container has-text-centered py-4">
<h1 class="title is-1 is-spaced">About</h1>
<h2 class="subtitle">Actuent is niche job board dedicated to students and recent college graduates who want find entry level jobs that are true to the name. We use natural language processing to analyze job descriptions provided by our partner, <a>talent.com</a>, to find jobs without an experience or graduate level educational requirement. Meet our founders!</h2>
<h2 class="subtitle">
Actuent is niche job board dedicated to students and recent
college graduates who want find entry level jobs that are true to
the name. We use the magic of regular expressions to analyze job
descriptions provided by our partner,
<a href=https://www.talent.com target="_blank">talent.com</a> (formerly
<a href=https://neuvoo.com target="_blank">neuvoo.com</a>), to find jobs without
any experience or graduate level educational requirement. Meet
our founders!</h2>

<div class="columns">
<div class="column">
<figure class="image container is-128x128">
<img class="is rounded" src="https://bulma.dev/placeholder/pictures/bg_circle.svg?primary=00d1b2">
<img class="is-rounded" src="https://www.gravatar.com/avatar/92dd63a560f2e808c29d3aa6d422adea?s=200">
</figure>
<p>Orton</p>
<p><a>@ortonbabb</a></p>
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras porta velit id augue convallis porta at vitae nisi."</p>
<p>"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."</p>
<p>— Orton (<a href=https://twitter.com/ortonbabb target="_blank">@ortonbabb</a>)</p>
</div>
<div class="column">
<figure class="image container is-128x128">
<img class="is rounded" src="https://bulma.dev/placeholder/pictures/bg_circle.svg?primary=00d1b2">
<img class="is-rounded" src="https://www.gravatar.com/avatar/52e8106176218d932ed002036fd12043?s=128">
</figure>
<p>Andrew</p>
<p><a>@AndrewHornstra</a></p>
<p>"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras porta velit id augue convallis porta at vitae nisi."</p>
<p>
"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."
</p>
<p>— Andrew (<a href=https://twitter.com/AndrewHornstra target="_blank">@AndrewHornstra</a>)</p>
</div>
</div>
<div>
<h1 class="title is-1 is-spaced" style="margin-top:3cm;">$$$$$</h1> <!-- Fix the hard coded spacing, probably bad on mobile. This is temporary. -->
<!-- <h1 class="title is-1 is-spaced" style="margin-top:3cm;">$$$$$</h1> -->

<!-- Fix the hard coded spacing, probably bad on mobile. This is temporary. -->
<h2 class="subtitle">
How do we keep the lights on? Some of the links you get when you
search with us have bids attached to them. When you click on
those links, we get a kickback for the bid amount. We don't
privilege paid links and we don't filter out unpaid links.
That's it. We don't collect any of your information, let alone
sell it. Find out more on our <a href="privacy.html">Privacy</a>
sell it. Find out more on our
<a href="{{ url_for('privacy') }}">Privacy</a>
page.
</h2>
</div>
Expand Down
15 changes: 8 additions & 7 deletions app/templates/contact.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,33 @@
<div class="hero-body">
<div class="container has-text-centered py-4">
<h1 class="title is-1 is-spaced">Contact</h1>
<h2 class="subtitle">Please reach out to us for (reasons).</h2>
<h2 class="subtitle">Please reach out to us with any feedback using the form below!</h2>

<div class="container py-4">
<div class="columns is-centered">
<div class="column is-8">
<form>
<form name="contact-form" action="https://formspree.io/f/xdoyoyld"
method="POST">
<div class="field is-grouped">
<div class="control is-expanded">
<input class="input" type="email" placeholder="Name">
<input class="input" type="text" placeholder="Name" name="_name" id="full-name">
</div>
<div class="control is-expanded">
<input class="input" type="email" placeholder="Email">
<input class="input" type="email" placeholder="Email" name="_replyto" id="email-address">
</div>
</div>
<div class="field mb-6">
<div class="control"><textarea class="textarea" rows="5" placeholder="Write something..."></textarea></div>
<div class="control"><textarea class="textarea" rows="5" placeholder="Write something..." name="_message" id="message" required=""></textarea> <input type="hidden" name="_subject" id="email-subject" value="Contact Form Submission"></div>
</div>
<div class="field my-5">
<div class="control has-text-centered">
<button class="button is-link" type="submit">Submit</button>
</div>
</div>
<div class="field has-text-centered">
<!-- <div class="field has-text-centered">
<p>Or just email us on</p>
<a href="#">contact@actuent.io</a>
</div>
</div> -->
</form>
</div>
</div>
Expand Down
21 changes: 16 additions & 5 deletions app/templates/credits.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,25 @@
<div class="hero-body">
<div class="container has-text-centered py-4">
<h1 class="title is-1 is-spaced">Credits</h1>
<h2 class="title ">Technical Credits</h2>
<!-- <h2 class="title ">Technical Credits</h2> -->
<img
src="https://bulma.io/images/made-with-bulma--black.png"
alt="Made with Bulma"
width="128"
height="24">
<p>Hosted on Heroku</p>
<h2 class="title ">Key References</h2>
width="256"
height="48">
<p>
Hosted on
<a href=https://www.heroku.com target="_blank">Heroku</a>
</p>
<p>
Jobs listings from
<a href=https://talent.com target="_blank">Talent.com</a>
</p>
<p>
Built with
<a href=https://flask.palletsprojects.com/ target="_blank">Flask</a>
</p>
<!-- <h2 class="title ">Key References</h2> -->
</div>
</div>
</section>
Expand Down
8 changes: 6 additions & 2 deletions app/templates/howitworks.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ <h2 class="title is-1">2</h2>
</div>
</div>
<h4 class="title is-4">We Find and Filter Jobs</h4>
<p>We find all the jobs available and use natural language processing to filter out non-entry level jobs</p>
<p>
We query <a href=https://www.talent.com target="_blank">Talent.com</a>
use pattern matching to score the results based on the keywords that appear
in the title and job description.
</p>
</div>
<div class="column">
<div class="media">
Expand All @@ -51,7 +55,7 @@ <h4 class="title is-4">Deliver Results to You</h4>
<p>We return the results with links to the job post!</p>
</div>
</div>
<div class="buttons is-centered"><a class="button is-link is-light" href="#">Read Our Whitepaper</a></div>
<!-- <div class="buttons is-centered"><a class="button is-link is-light" href="#">Read Our Whitepaper</a></div> -->
</div>
</div>
</div>
Expand Down
6 changes: 5 additions & 1 deletion app/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<div class="hero-body">
<div class="container has-text-centered py-4">
<h1 class="title is-1 is-spaced">Find jobs that are actually entry-level</h1>
<h2 class="subtitle">Search our verified listings...</h2>
<h2 class="subtitle">Search our rated listings</h2>
<div class="container landing-container">
<form action="/" method="post">
<div class="columns is-mobile box search-box">
Expand Down Expand Up @@ -43,6 +43,10 @@ <h2 class="subtitle">Search our verified listings...</h2>
</div>
</div>
</div>
<!-- <a href="javascript:void(0)" onClick="return actuent_favorite(this);" class="button is-floating is-light is-link"> -->
<!-- <i class="fas fa-shopping-cart"></i> -->
<!-- &#9734; -->
<!-- </a> -->
<!--<div class="container landing-container">
<div class="field is-horizontal">
<div class="field-label">
Expand Down
Loading

0 comments on commit ab14c6b

Please sign in to comment.