Skip to content

Instantly share code, notes, and snippets.

View solyard's full-sized avatar
💫
Shooting stars

Vladislav solyard

💫
Shooting stars
  • Russia
View GitHub Profile
def show_q(bot, update):
x = update.message.text.split(' ')
print(x)
if len(x) <= 1 or len(x) > 3:
print('FALSE')
else:
if x[0] == '!!qq':
try:
k = int(x[1])
except (ValueError, IndexError):
def forward_messages(bot, update):
upd = update.to_dict()
"""MASS SAVING"""
chatid = upd['message']['chat']['id']
msg = upd['message']['text']
if msg == '/cleardb':
pass
elif msg == '/done':
@solyard
solyard / main.py
Last active February 23, 2018 17:44
def parsing_data():
for i in main.urls:
data, data2 = [], []
r = requests.get(i, headers=main.headers)
text = r.text
doc = fromstring(text)
block = doc.cssselect("#tabs-last-pos > div > div > div.table-cell.cell-full.collapse-768")[0]
import psycopg2
import json
class Database:
@staticmethod
def insert(data):
insert_data = ''
insert_data_row = []
field_order = tuple({key for request in data for key in request.keys()})
import asyncpg
import ujson
class Transaction:
def __init__(self, pool):
self.pool = pool
async def __aenter__(self):
self.acquire_context = self.pool.acquire()
apiVersion: v1
kind: Secret
metadata:
name: akhq-secrets
labels:
app.kubernetes.io/name: akhq
type: Opaque
stringData:
application-secrets.yml: |
akhq:
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"sync"
)