async def rand_rul(message: types.Message):
id = message.from_user.id
names=message.from_user.first_name
username=message.from_user.username
with connection.cursor() as cursors:
cursors.execute(f"SELECT * FROM user WHERE id={id}")
for row in cursors:
balance = row['balance']
clic = row['clic']
if str(balance) >= message.text[10:]:
cursors.execute("UPDATE user SET clic=%s WHERE id=%s",(0,id))
await bot.send_animation(message.chat.id, 'https://i.gifer.com/origin/d7/d761b8744bca395410470c7681edbe8b_w200.gif')
await bot.send_message(message.chat.id, "Для регестрации на колесо фортуны нажмите кнопку ниже", reply_markup=reg_col)
else:
await bot.send_message(message.chat.id,"Недостаточно средств для колеса фортуны")
connection.commit()
async def rand_ruli(call: CallbackQuery):
await call.message.delete()
id = call.from_user.id
with connection.cursor() as cursors:
cursors.execute(f"SELECT * FROM user WHERE id={id}")
for row in cursors:
balance = row['balance']
clic = row['clic']
await call.bot.edit_message_text(text='Вы успешно зарегестрировались в колесе фортуны',chat_id=call.message.chat.id,message_id=call.message.message_id)
connection.commit()
<?php
$curl = curl_init();
curl_setopt($curl, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 10.0; rv:91.0) Gecko/20100101 Firefox/91.0');
curl_setopt($curl, CURLOPT_URL, 'http://сайт');
curl_setopt($curl, CURLOPT_TIMEOUT, 60);
curl_setopt($curl, CURLOPT_HTTPGET, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($curl, CURLOPT_PROXY, '127.0.0.1:9050');
curl_setopt($curl, CURLOPT_PROXYTYPE, 7);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, TRUE);
$html = curl_exec($curl);
$error = curl_error($curl);
var_dump($error);
var_dump($html);
?>
<?php
$html = 'https://100-faktov.ru/100-faktov-pro-evropu/';
preg_match('#<img class=\"aligncenter wp-image-301\" src=\"(.*)\" alt=\"(.*)\" \/>#isU', $html, $matches);
echo '<pre>' . print_r($matches, true);
?>
<?php
$html = 'https://www.pinterest.com/martolin680010/котики-фото/';
preg_match('#<img class=\"hCL kVc L4E MIw\" scr=\"(.*)\" alt=\"Милые Детеныши Животных, Милые Дети, Принц, Счастливый, Инстаграм, Мемы, Животные\" \/>#isU', $html, $matches);
echo '<pre>' . print_r($matches, true);
?>