Clear screen after db update
This commit is contained in:
parent
e707594eb8
commit
e6e9d582bc
16
main.py
16
main.py
|
@ -1,14 +1,23 @@
|
||||||
import httpx
|
import httpx
|
||||||
import time
|
import time
|
||||||
import modules
|
import modules
|
||||||
import os
|
from os import system, name, environ
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from supabase import create_client, Client
|
from supabase import create_client, Client
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
url: str = os.environ.get("SUPABASE_URL")
|
url: str = environ.get("SUPABASE_URL")
|
||||||
key: str = os.environ.get("SUPABASE_KEY")
|
key: str = environ.get("SUPABASE_KEY")
|
||||||
supabase: Client = create_client(url, key)
|
supabase: Client = create_client(url, key)
|
||||||
|
|
||||||
|
def clear():
|
||||||
|
|
||||||
|
if name == 'nt':
|
||||||
|
_ = system('cls')
|
||||||
|
|
||||||
|
else:
|
||||||
|
_ = system('clear')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def scraper():
|
def scraper():
|
||||||
transport = httpx.HTTPTransport(retries=5)
|
transport = httpx.HTTPTransport(retries=5)
|
||||||
|
@ -40,6 +49,7 @@ def post(item):
|
||||||
while True:
|
while True:
|
||||||
try:
|
try:
|
||||||
scraper()
|
scraper()
|
||||||
|
clear()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
print("Database updated")
|
print("Database updated")
|
||||||
|
|
Loading…
Reference in New Issue