Skip to content

Commit

Permalink
Merge pull request #5 from alexxykv/release-site
Browse files Browse the repository at this point in the history
Alpha version
  • Loading branch information
ksamnole authored Jun 20, 2021
2 parents b17eace + 88f90e9 commit c4b71a4
Show file tree
Hide file tree
Showing 9 changed files with 284 additions and 28 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
# assessor
# Assessor

## Описание
*Упрощение и ускорение поиска лучших кандидатов, их предварительной оценки по данным из резюме и открытых источников.
После получения резюме в формате hh.ru или ФИО, требуемых технических навыков и личных качеств, сервис выполняет поиск данных о кандидате в соц. сетях, открытых репозиториях и тд. Полученные данные анализируются для оценки навыков и экспертизы. А также проверки соответствия личных качеств и ценностей приемлемым в коллективе.*

## Цель
*Скриннинг кандидата на вакансии ИТ по данным из резюме и из открытых источников (hh.ru, linkedin, habr, github, bitbucket.org, соц.сети и тд).*

## Итоговый продукт
*Web-сервис/Telegram-бот
Оценка кандидата за разумное время (до 5 минут), предоставление развернутого отчета о навыках и личных качествах кандидата.*
48 changes: 36 additions & 12 deletions main/templates/main/result.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,35 @@ <h5>Дата рождения: <span class="lead">{% if info.date_birth %}{{ inf
Неизвестно{% endif %}</span></h5>
<h5>Город: <span class="lead">{% if info.city %}{{ info.city }}{% else %}
Неизвестно{% endif %}</span></h5>
<h5>Общая оценка: {{ info.ratio }}</h5>
{% if github %}
<h5>Оценка по github: {{ github.ratio }}</h5>
{% endif %}
{% if habr %}
<h5>Оценка по habr: {{ habr.ratio }}</h5>
{% endif %}


</div>
<div class="col">
{% load static %}
<img src="{% if photo %}{{ photo }}{% else %}{% static 'main/img/anon.png' %}{% endif %}" alt="photo" style="width: 200px; height: 200px;">
<img src="{% if photo %}{{ photo }}{% else %}{% static 'main/img/anon.png' %}{% endif %}" alt="photo"
style="width: 200px; height: 200px;">
</div>
<div class="col"></div>
</div>
<hr class="my-4">
<!-- END MAIN INFO -->
<!-- LINKEDIN -->
{% if linkedin %}
<h4 class="mb-4">LinkedIn <a href="#"
onclick="show('show_linkedin', 'hide_linkedin'); view('hidden_linkedin'); return false">
<span><i class="fas fa-caret-square-down" id="show_linkedin"></i></span>
<span id='hide_linkedin'></span></a></h4>
<hr class="my-4">
<div id="hidden_linkedin" style="display: block;">
{% include 'main/results/linkedin.html' %}
</div>
<hr class="my-4">
<h4 class="mb-4">LinkedIn <a href="#"
onclick="show('show_linkedin', 'hide_linkedin'); view('hidden_linkedin'); return false">
<span><i class="fas fa-caret-square-down" id="show_linkedin"></i></span>
<span id='hide_linkedin'></span></a></h4>
<hr class="my-4">
<div id="hidden_linkedin" style="display: block;">
{% include 'main/results/linkedin.html' %}
</div>
<hr class="my-4">
{% endif %}
<!-- END LINKEDIN -->
<!-- HABR -->
Expand All @@ -57,7 +65,7 @@ <h4 class="mb-4">Habr - {{ habr.ratio }} <a href="#"
{% endif %}
<!-- END HABR -->
<!-- GITHUB -->
{% if github != None %}
{% if github %}
<h4 class="mb-4">Github - {{ github.ratio }} <a href="#"
onclick="show('show_github', 'hide_github'); view('hidden_github'); return false">
<span><i class="fas fa-caret-square-down" id="show_github"></i></span>
Expand All @@ -71,6 +79,22 @@ <h4 class="mb-4">Github - {{ github.ratio }} <a href="#"
<hr class="my-2">
{% endif %}
<!-- END GITHUB -->
<!-- CODEFORCES -->
{% if codeforces %}
<h4 class="mb-4">Codeforces <a href="#"
onclick="show('show_codeforces', 'hide_codeforces'); view('hidden_codeforces'); return false">
<span><i class="fas fa-caret-square-down" id="show_codeforces"></i></span>
<span id="hide_codeforces"></span>
</a>
</h4>
<hr class="my-4">
<div id="hidden_codeforces" style="display: block;">
{% include 'main/results/codeforces.html' %}
</div>
<hr class="my-2">
{% endif %}
<!-- END CODEFORCES -->

{% include 'main/scripts/show_hide.html' %}
<!-- SHERLOCK -->
{% if sherlock %}
Expand Down
17 changes: 17 additions & 0 deletions main/templates/main/results/codeforces.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<div class="row g-3">
<div class="col-sm-6">
<p class="lead">Nickname: <a href="{{ codeforces.user.url }}">{{ codeforces.user.handle }}</a></p>
<p class="lead">Rating: {{ codeforces.user.rating }}</p>
<p class="lead">Max rating: {{ codeforces.user.maxRating }}</p>
<p class="lead">Contribution: {{ codeforces.user.contribution }}</p>
<p class="lead">Rank: {{ codeforces.user.rank }}</p>
<p class="lead">Max rank: {{ codeforces.user.maxRank }}</p>
</div><div class="col-sm-6">
<p class="lead">Blogs:</p>
<ul>
{% for blog in codeforces.blogs %}
<li><a style="text-decoration: none;" href="{{ blog.url }}">{{ blog.title }}</a> - <i>{{ blog.rating }}</i> (rating)</li>
{% endfor %}
</ul>
</div>
</div>
2 changes: 1 addition & 1 deletion main/templates/main/results/habr.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{% include 'main/scripts/habr_avg_graph.html' %}
</div>
<div class="col-sm-6">
<p class="lead">Место работы: {{ habr.main.work_name }}</p>
<p class="lead">Место работы: {% if habr.main.work_name %}{{ habr.main.work_name }}{% else %}Неизвестно{% endif %}</p>
<h4><p class="lead">Среднее по статьям:
<p class="lead">- Voitings: {{ habr.avgs.voitings }}
{% if habr.analysis.voitings >= 0 %}
Expand Down
1 change: 1 addition & 0 deletions main/templates/main/results/linkedin.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<div class="row g-3">
<div class="col-sm-6">
<p class="lead"><a href="{{ linkedin.url }}">Profile</a></p>
{% if linkedin.headline %}
<p class="lead">Обо мне: <i>{{ linkedin.headline }}</i></p>
{% endif %}
Expand Down
8 changes: 7 additions & 1 deletion main/url_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ def __init__(self, sites, sherlock):
self.sherlock = sherlock

def check(self):
pars_dict = {'github.com': self.github, 'habr.com': self.habr, 'www.linkedin.com': self.linkedin}
pars_dict = {'github.com': self.github, 'habr.com': self.habr, 'www.linkedin.com': self.linkedin,
'codeforces.com': self.codeforces}
for i in range(0, len(self.sites)):
self.url = self.sites[i]
domen = re.findall(r'//([^/]*\.[^/:]+)', self.url)[0]
Expand All @@ -24,6 +25,11 @@ def check(self):
self.result['habr.com'] = pars_dict['habr.com']()
return self.result

def codeforces(self):
url = (self.url + '/').replace('//', '/')
nick = url.split('/')[-2]
return nick

def linkedin(self):
url = (self.url + '/').replace('//', '/')
nick = url.split('/')[-2]
Expand Down
45 changes: 32 additions & 13 deletions main/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
from django.http import HttpResponse
from sher import run
from linkedin_api import Linkedin
from parsing.codeforces.codeforces import Codeforce
import urllib.parse
import pdfcrowd
from django.template import RequestContext
import json


def index(request):
Expand Down Expand Up @@ -61,22 +60,21 @@ def result(request):
flag = True
if flag:
user_vk = Data.get_vk(info)
sherlock = run.search(user_vk[0]['screen_name']) if user_vk else None
sherlock = None
if user_vk:
vk_nickname = user_vk[0]['screen_name']
sherlock = run.search(vk_nickname)
urls = CheckUrl(getting_sites(sites), sherlock).check()
github = add_github(urls)
habr = add_habr(urls)
linkedin = add_linkedin(urls)
info['ratio'] = 0
if github:
info['ratio'] += github['ratio'] * 0.6
if habr:
info['ratio'] += habr['ratio'] * 0.4
info['ratio'] = round(info['ratio'], 2)
linkedin = add_linkedin(urls, info)
codeforces = add_codeforces(urls, user_vk)
data = {
'form': form,
'habr': habr,
'github': github,
'linkedin': linkedin,
'codeforces': codeforces,
'vk': user_vk[0] if user_vk else None,
'sherlock': sherlock,
'info': info,
Expand All @@ -96,15 +94,36 @@ def result(request):
return redirect('/')


def add_linkedin(urls):
def add_codeforces(urls, user_vk):
if 'codeforces.com' in urls:
nick = urls['codeforces.com']
elif user_vk:
nick = user_vk[0]['screen_name']
else:
return None
code = Codeforce()
code_user = code.user_info([nick])
if len(code_user) != 0:
return {
'user': code_user[0],
'blogs': code.user_blog_entries(nick)
}


def add_linkedin(urls, info):
api_link = Linkedin('+79065350750', '1qaz2wsx3edC')
if 'www.linkedin.com' in urls:
api_link = Linkedin('+79065350750', '1qaz2wsx3edC')
nickname = urls['www.linkedin.com']
else:
linkedin = api_link.search_people(keyword_first_name=info['first_name'], keyword_last_name=info['last_name'])
nickname = linkedin[0]['public_id'] if linkedin else None
if nickname:
profile = api_link.get_profile(nickname)
contact = api_link.get_profile_contact_info(nickname)
network = api_link.get_profile_network_info(nickname)
linkedin = profile | contact | network
linkedin['skills'] = api_link.get_profile_skills(nickname)
linkedin['url'] = 'https://www.linkedin.com/in/' + linkedin['profile_id']
# linkedin['updates'] = api_link.get_profile_updates(nickname, max_results=2)
# print(json.dumps(linkedin['updates']))
return linkedin
Expand All @@ -113,7 +132,7 @@ def add_linkedin(urls):

def add_habr(urls):
if 'habr.com' in urls:
# Mereics
# Metrics
avg_values = {
'karma': 46.6,
'rating': 87.6,
Expand Down
Loading

0 comments on commit c4b71a4

Please sign in to comment.