-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathclocks.py
More file actions
144 lines (132 loc) · 4.78 KB
/
clocks.py
File metadata and controls
144 lines (132 loc) · 4.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import base64, codecs, json, requests
import pickle
import os
import sys
import simplejson as json
from pycoingecko import CoinGeckoAPI
from cfonts import render, say
import time as t
import requests
import subprocess
import random
from stem import Signal
from stem.control import Controller
ver = "0.0.20"
faceshappy = {
"SLEEP" : '(⇀‿‿↼)',
"SLEEP2" : '(≖‿‿≖)',
"AWAKE" : '(◕‿‿◕)',
"INTENSE" : '(°▃▃°)',
"COOL" : '(⌐■_■)',
"HAPPY" : '(•‿‿•)',
"GRATEFUL" : '(^‿‿^)',
"EXCITED" : '(ᵔ◡◡ᵔ)',
"MOTIVATED" : '(☼‿‿☼)',
"SMART" : '(✜‿‿✜)',
"FRIEND" : '(♥‿‿♥)'
}
faceslookaround = {
"LOOK_R" : '( ⚆_⚆)',
"LOOK_L" : '(☉_☉ )',
"LOOK_R_HAPPY" : '( ◕‿◕)',
"LOOK_L_HAPPY" : '(◕‿◕ )'
}
facessad = {
"BORED" : '(-__-)',
"DEMOTIVATED" : '(≖__≖)',
"LONELY" : '(ب__ب)',
"SAD" : '(╥☁╥ )',
"ANGRY" : '(-_-)',
"BROKEN" : '(☓‿‿☓)'
}
def clear(): # clear the screen
os.system('cls' if os.name=='nt' else 'clear')
#-----------------------------COINGECKO--------------------------------
def CoingeckoPP():
btcInfo = CoinGeckoAPI()
n = btcInfo.get_price(ids='bitcoin', vs_currencies='usd')
q = n['bitcoin']
usd = q['usd']
output = render(str(usd), colors=['white', 'black'], align='center', font='simple')
print("\a\x1b[?25l" + output)
#-----------------------------END COINGECKO--------------------------------
def blocks():
try:
btcInfo = CoinGeckoAPI()
k = btcInfo.get_price(ids='bitcoin', vs_currencies='usd')
q = k['bitcoin']
usd = q['usd']
h = (1 / usd) * 100000000
s = int(h)
clear()
r = requests.get('https://mempool.space/api/blocks/tip/height')
r.headers['Content-Type']
n = r.text
di = json.loads(n)
a = di
b = str(a)
clear()
pp = random.choice(list(faceslookaround.values())).encode('utf-8').decode('latin-1')
output5 = subprocess.check_output(['sudo', 'iwgetid'])
z = str(output5)
print("PyBLOCK Micro " + ver + " ---> Connected to: " + z.split('"')[1] + " & Tor")
print("BLOCK " + str(pp))
output = render(str(b), colors=['white', 'black'], align='center', font='simple')
print(output)
print("PRICE: " + str(s) + " sats = 1 USD")
CoingeckoPP()
while True:
x = b
r = requests.get('https://mempool.space/api/blocks/tip/height')
r.headers['Content-Type']
n = r.text
di = json.loads(n)
a = di
if x < str(a):
btcInfo = CoinGeckoAPI()
k = btcInfo.get_price(ids='bitcoin', vs_currencies='usd')
q = k['bitcoin']
usd = q['usd']
h = (1 / usd) * 100000000
s = int(h)
clear()
output5 = subprocess.check_output(['sudo', 'iwgetid'])
z = str(output5)
pp = random.choice(list(faceshappy.values())).encode('utf-8').decode('latin-1')
print("PyBLOCK Micro " + ver + " ---> Connected to: " + z.split('"')[1] + " & Tor")
print("BLOCK " + str(pp))
output = render(str(a), colors=['white', 'black'], align='center', font='simple')
print(output)
print("PRICE: " + str(s) + " sats = 1 USD")
CoingeckoPP()
b = str(a)
except:
pp = random.choice(list(facessad.values())).encode('utf-8').decode('latin-1')
os.system("sudo sh boot.sh")
print("Bad Connection... Restarting... " + str(pp))
while True:
try:
r = requests.get('https://raw.githubusercontent.com/curly60e/pyblockmicro/main/ver.txt')
r.headers['Content-Type']
n = r.text
di = json.loads(n)
if di['version'] == ver:
print(" ")
else:
gitfetch = "git fetch"
gitchekcout = "git checkout origin/main -- .bashrc README.md clocks.py clocksLOCAL.py papertty.service requirements.txt start.sh torrc first.sh boot.sh "
rootfile = "sudo chown root:root start.sh;sudo chmod 700 start.sh"
clear()
b = os.popen(gitfetch).read()
a = os.popen(gitchekcout).read()
root = os.popen(rootfile).read()
print(b)
print(a)
print(root)
os.system("pip3 install -r requirements.txt")
os.system("sudo chown root:root start.sh;sudo chmod 700 start.sh")
blocks()
except:
pp = random.choice(list(facessad.values())).encode('utf-8').decode('latin-1')
os.system("sudo sh boot.sh")
print("Bad Connection... Restarting... " + str(pp))