Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
FanaticExplorer committed Dec 2, 2021
0 parents commit 6043c7d
Show file tree
Hide file tree
Showing 9 changed files with 88 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .idea/.gitignore

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

10 changes: 10 additions & 0 deletions .idea/Eolymp_bot.iml

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

6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

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

4 changes: 4 additions & 0 deletions .idea/misc.xml

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

8 changes: 8 additions & 0 deletions .idea/modules.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

14 changes: 14 additions & 0 deletions bot.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import discord
from discord.ext import commands

bot = commands.Bot(command_prefix='>')

@bot.event
async def on_ready():
print(f'{bot.user} has connected to Discord!')

@bot.command()
async def ping(ctx):
await ctx.send('pong')

bot.run('OTE0MjIyMzU2NDkzMzc3NTc2.YaJ56w.9RC7c4WiorqTe9_iyn2-1T5V-eo')
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import requests
from bs4 import BeautifulSoup

user = input("Впишите никнейм нужного пользователя: ")

profile_url = 'https://www.eolymp.com/uk/users/'+user
profile_response = requests.get(profile_url)
profile_soup = BeautifulSoup(profile_response.text, 'lxml')

numbers = profile_soup.find_all('div', class_='eo-metric__value')
rating = numbers[0].text
solved = numbers[1].text
total_submissions = numbers[2].text
submits = numbers[3].text

print(f'Рейтинг пользователя {user}: {rating}')
print(f'Количество решенных задач: {solved}')
print(f'Всего отправок: {total_submissions}')
print(f'Количество засчитанных отправок: {submits}')

problems_url = 'https://www.eolymp.com/uk/users/'+user+'/submissions'
problems_response = requests.get(problems_url)
problems_soup = BeautifulSoup(problems_response.text, 'lxml')

problems = problems_soup.find_all('tr')
last_problem = problems[1].find_all('td', class_='mdl-data-table__cell--non-numeric')
last_problem_name = last_problem[1].find('a').text
last_problem_state = last_problem[4].find('a').text

if 'Зараховано' in last_problem_state:
print(f'''Последняя задача "{last_problem_name}" пройдена на 100%''')
elif 'Частково зараховано' in last_problem_state:
last_problem_percent = int((last_problem_state.split()[-1])[:-1])
print(f'''Последняя задача "{last_problem_name}" пройдена на {last_problem_percent}%''')
else:
print('Произошли технические шоколадки')
print(last_problem_state)

0 comments on commit 6043c7d

Please sign in to comment.