ЙажаСценарий / Говнокод #28050 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
  18. 18
  19. 19
  20. 20
  21. 21
  22. 22
  23. 23
  24. 24
  25. 25
  26. 26
  27. 27
  28. 28
  29. 29
  30. 30
  31. 31
  32. 32
  33. 33
  34. 34
  35. 35
  36. 36
  37. 37
  38. 38
  39. 39
  40. 40
  41. 41
  42. 42
  43. 43
  44. 44
  45. 45
  46. 46
  47. 47
  48. 48
  49. 49
  50. 50
  51. 51
  52. 52
  53. 53
  54. 54
  55. 55
  56. 56
  57. 57
  58. 58
  59. 59
  60. 60
  61. 61
  62. 62
  63. 63
  64. 64
  65. 65
  66. 66
  67. 67
  68. 68
  69. 69
  70. 70
  71. 71
  72. 72
  73. 73
  74. 74
  75. 75
  76. 76
  77. 77
  78. 78
  79. 79
  80. 80
  81. 81
  82. 82
  83. 83
  84. 84
  85. 85
  86. 86
  87. 87
  88. 88
  89. 89
  90. 90
  91. 91
  92. 92
  93. 93
  94. 94
  95. 95
  96. 96
  97. 97
  98. 98
  99. 99
from lib2to3.pgen2 import token
import logging
import re

import requests
import pandas as pd

from bs4 import BeautifulSoup

from aiogram import Bot, Dispatcher, executor, types
from aiogram.dispatcher.filters import Text

bot = Bot(token="5243563589:AAHZL9JyJ0Q36dBpuXcjgzDuM-0n9OEWhpk")
dp = Dispatcher(bot)
logging.basicConfig(level=logging.INFO)

sso = "http://pinskgptklp.brest.by/sso.html"
pto = "http://pinskgptklp.brest.by/pto2.html"
logg = ""

response = requests.get(sso)
soup = BeautifulSoup(response.text, "lxml")
quotes = soup.find_all("tbody")
t = str(quotes)
arr = t.split('</tbody>, ')
stroka = arr[1]
stroki = stroka.split('<tr')

i = 1
j = 0

tablica = [0] 8
ttt = [[]] 8

tab1 = [0] len(stroki)
while i < len(tab1):
j = 0
tab1 = re.sub(r'\n+', '\n', stroki)
tab1 = re.sub(r'\<[^>]\>', '', "<" + stroki).split('\n')
while j < len(tab1):
if tab1[j] != "" and tab1[j] != "]":
logg += '|' + tab1[j]

j = j + 1

logg += '~'
i = i + 1

q = []
rem = logg.split('~')
o = 0
while o < len(rem):
q.append(rem.split('|'))
o = o + 1

o = 0
while o < len(rem):
o = o + 1

print(q)

sso_sh = q[4][1] + q[4][2] + q[4][3] + q[4][4] + '\n' + q[0][2] + " - " + q[4][5] + '\n' + q[0][3] + " - " + q[4][8]
sso_p = q[5][1] + q[5][2] + q[5][3] + q[5][4] + '\n' + q[0][2] + " - " + q[5][5] + '\n' + q[0][3] + " - " + q[5][8]

@dp.message_handler(commands="start")
async def cmd1(message: types.Message):
keyboard = types.InlineKeyboardMarkup()
keyboard.add(types.InlineKeyboardButton(text="ПТО", callback_data="n1"))
keyboard.add(types.InlineKeyboardButton(text="CCO", callback_data="n2"))
await message.answer("Действия:", reply_markup=keyboard)

#@dp.message_handler(Text(equals="Показать что-то"))
#async def cmd2(message: types.Message):
#await message.reply(stroki[1])

@dp.callback_query_handler(text="see")
async def see(call: types.CallbackQuery):
await call.message.answer("123123123")
await call.answer()

@dp.callback_query_handler(text="n1")
async def next(call: types.CallbackQuery):
keyboard = types.InlineKeyboardMarkup()
keyboard.add(types.InlineKeyboardButton(text=q[4][3], callback_data="pto1"))
keyboard.add(types.InlineKeyboardButton(text=q[5][3], callback_data="pto2"))
await call.message.answer("Что именно?", reply_markup=keyboard)
await call.answer()

@dp.callback_query_handler(text="n2")
async def next(call: types.CallbackQuery):
keyboard = types.InlineKeyboardMarkup()
keyboard.add(types.InlineKeyboardButton(text=q[4][3], callback_data="sso1"))
keyboard.add(types.InlineKeyboardButton(text=q[5][3], callback_data="sso2"))
await call.message.answer("Что именно?", reply_markup=keyboard)
await call.answer()

@dp.callback_query_handler(text="sso1")
async def next(call: types.CallbackQuery):
await call.message.answer(sso_sh)

Саб, нужна помощь с ботом, нужно сделать 2 часть с кнопкой ПТО, а то не получается спарсить

Запостил: dddccc dddccc, (Updated )

Комментарии (4) RSS

  • Необычной особенностью языка является выделение блоков кода пробельными отступами
    Ответить
  • Саб

    Возможно, это код прошивки для штатного усилка какого-нибудь сабвуфера.
    Ответить
  • Мимо тещиного блога
    Я без шуток не хожу
    То ей что-то покажу
    То "Что именно?" спрошу.
    Ответить

Добавить комментарий

Помни, guest, за тобой могут следить!

    А не использовать ли нам bbcode?


    8