-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path4-socio-por-idtelegram.py
executable file
·46 lines (36 loc) · 1.18 KB
/
4-socio-por-idtelegram.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
#!/usr/bin/env python
import sys
import common
id = False
if len(sys.argv) > 1:
try:
id = int(sys.argv[1])
except Exception:
id = False
if not id:
print("Telegram ID required")
sys.exit(-1)
print("Loading file from disk")
socios = common.readjson(filename="socios")
validids = []
invalidids = []
print("Procesando socios")
for socio in socios:
if isinstance(socio["campsDinamics"], dict):
for field in common.telegramfields:
if field in socio["campsDinamics"]:
if (
"estat" in socio
and socio["estat"] == "COLESTVAL"
and "estatColegiat" in socio
and socio["estatColegiat"]["nom"] == "ESTALTA"
):
try:
idbb = int(socio["campsDinamics"][field])
except Exception:
idbb = False
if idbb and idbb == id:
print(
"Socio: https://asociacionavast.playoffinformatica.com/FormAssociat.php?idColegiat=%s"
% socio["idColegiat"]
)