-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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') |
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) |