-
Notifications
You must be signed in to change notification settings - Fork 2
/
garoa.1m.py
executable file
·69 lines (59 loc) · 3.26 KB
/
garoa.1m.py
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
#!/usr/bin/env python3
# Umbrella icon by FontAwesome: https://fontawesome.com/icons/umbrella
# Creative Commons Attribution 4.0: https://fontawesome.com/license
# <bitbar.title>Garoa Hacker Clube Status</bitbar.title>
# <bitbar.version>v1.3</bitbar.version>
# <bitbar.author>Fabricio Biazzotto</bitbar.author>
# <bitbar.author.github>biazzotto</bitbar.author.github>
# <bitbar.desc>Exibe o status atualizado do Garoa Hacker Clube.</bitbar.desc>
# <bitbar.image>https://i.imgur.com/8nFc3VO.png</bitbar.image>
# <bitbar.dependencies>python3,requests</bitbar.dependencies>
try:
from requests import get
from requests.exceptions import ConnectionError
except ModuleNotFoundError:
print('ERRO')
print('---')
print('Clique aqui para instalar <tt>requests</tt>.|bash="sudo -H python3'
' -m pip install requests&&exit" terminal=true refresh=true')
from json import loads
gray = 'iVBORw0KGgoAAAANSUhEUgAAABQAAAASCAYAAABb0P4QAAABkklEQVQ4y6WUu0ub' + \
'YRSHn/dNQtpRa+jQC162LqW6dLAgdSkWl86CS4eCQgadHMIvAROHVsEbfIP/gAhF' + \
'EAcXQXBw6aAgLraUBhLEIYKgX/iat8uHhGguTX7juTwv55z3HEMTeZ4XKxQKR0AF' + \
'eCspaBRvm8GKxeIw8AYYMsa88zwv1ijHPGSUNAJMAR+BxzXuG2AHWJV00BCYzWYT' + \
'5XJ5AxinNW0DnyVd3gNK6gf2gZf8n34D7yX9vAPmcrku3/d/AL20p1/AoKSSBfB9' + \
'f6UDGEAfsAJgJL0CTppNvAU5a+1rG06zUxiAqVQqXywwBiwBiXg83g18q34VWACe' + \
'AQngaw1kEXgCP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BF4Mk473oKa4xGnmFaAQLPN7l5lq9/CVuc' + \
'SLxNHPNvfIlcHufzH2GLkYwajhuM5cTpCdYjZDzehQzGwpZDqHEystiv4gVIkUrc' + \
'Q/U/yCAkbsXEFB60tyq8HzOdt+JuxuE2o4n7XZLZMgcCh/AoMaXOZE4fPmyQmtxb' + \
'YqjJmwavlxiqc6dBajCbc24yt7GX2bvB3DDV7xxMrGy3xNESa5s8Heb2GD8LTUon' + \
'TY50CiusDjzLg1DKrT9hkattPuDXroV1rkReBj4l5rbDWYn1AvO9Y94+dv00r05x' + \
'rZ8wN4cVVgPTiRY2EvOBG0We/BtUr2OKb+a2RgAAAABJRU5ErkJggg=='
try:
status = loads(get('https://garoahc.appspot.com/status').content)['open']
if status:
img = green
else:
img = red
except ConnectionError:
img = gray
print(f"|image={img}")
print('---')
print('Visite nosso site | href=https://garoa.net.br')
print('Atualizar status | refresh=true')