Compare commits

...

8 Commits

Author SHA1 Message Date
Simple_Not
b646c73f47 remake many certs
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-17 12:36:23 +10:00
Simple_Not
2a93b636dc fixxxxx
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-16 15:02:57 +10:00
Simple_Not
2cb35e8015 fixxxxx
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-16 15:01:43 +10:00
Simple_Not
8a322efa6b fixxxxx
Some checks failed
continuous-integration/drone/push Build is failing
2023-07-16 15:00:36 +10:00
Simple_Not
bbc5207cb4 retunk metrics
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-13 19:25:22 +10:00
Simple_Not
a3fbd02692 retunk metrics
All checks were successful
continuous-integration/drone/push Build is passing
2023-07-13 18:26:36 +10:00
Simple_Not
e8bed9a381 retunk metrics 2023-07-13 18:25:01 +10:00
639e5ecc2e Пофиксил метрику
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-22 17:37:13 +10:00
4 changed files with 38 additions and 36 deletions

View File

@@ -18,8 +18,8 @@ steps:
- name: pull into the folduh
commands:
- cd /usr/share/$DRONE_REPO_NAME
- git pull
- chown -R jack:jack .
- su -c "git pull" jack
#- chown -R jack:jack .
when:
branch:
- BIG_DICK_COCK

View File

@@ -1 +0,0 @@
Оно собирает хуи!

View File

@@ -1,32 +1,13 @@
from sqlalchemy import create_engine, Integer, String, BIGINT, Column, DateTime
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from sqlalchemy import select, update
from flask import Flask
#### https://docs.python-arango.com/en/main/
from arango import ArangoClient
app = Flask(__name__)
engine = create_engine('postgresql+psycopg2://postgres:postgres@postgres.vdk2ch.ru:5432/jack_bot', echo=True)
Session = sessionmaker(bind=engine)
Base = declarative_base()
class user(Base):
__tablename__ = 'users'
id = Column(Integer, primary_key=True)
user_id = Column(Integer)
user_fullname = Column(String)
dick_size = (Column(Integer))
datetimes = (Column(DateTime))
chat_id = Column(BIGINT)
@@ -34,14 +15,22 @@ class user(Base):
def get_top_dicks():
session = Session()
arango_client = ArangoClient(hosts='https://arango.guaranteedstruggle.host')
pipisa_db = arango_client.db('pipisa', username='root', password='stolendick527')
dicks_collection = pipisa_db.collection('dicks')
top = session.query(user.user_fullname, user.dick_size, user.user_id, user.chat_id).order_by(user.dick_size.desc()).all()
dicks = dicks_collection.all( )
dicks = [[
d['user_fullname'],
d['dick_size'],
d['user_id'],
d['chat_id'],
d['attempts'],
] for d in dicks]
session.close()
dicks = sorted(dicks, key=lambda dick: dick[1], reverse=True)
return top
return dicks
@@ -54,8 +43,15 @@ def metrics():
# текущий размер пипис
for dick in docks:
metrics += 'pipisio{user="%s", user_id="%s", chat_id="%s"} %s\n' % (dick[0], dick[2], dick[3], dick[1])
metrics += 'pipisio{user="%s", user_id="%s", chat_id="%s"} %s\n' % (dick[0], dick[2], dick[3], dick[1])
# текущее число попыток
for dick in docks:
metrics += 'pipisio_attempto{user="%s", user_id="%s", chat_id="%s"} %s\n' % (dick[0], dick[2], dick[3], dick[4])
docks = [ d for d in docks if d[3] == -1001355646177]
# расстояние до следующего впереди
for k in range(len(docks)):
@@ -75,6 +71,7 @@ def metrics():
return metrics
if __name__ == '__main__':
app.run(host='0.0.0.0', port=9992)
engine.dispose()
app.run(host='0.0.0.0', port=9992)

6
requirements.txt Normal file
View File

@@ -0,0 +1,6 @@
aiogram
sqdb
sqlalchemy
graypy
flask
psycopg2