-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
35 lines (32 loc) · 1 KB
/
main.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
from pandas import ExcelFile
from Twitter.mandarTweet import escribirTweet
from Twitter.armarTwit import armarTwit
from spotify.musica import agregarCancion
from shazam.reconocerCancionShazam import averiguarCancion
from shazam.radio import grabar
import time
from Telegram.mandarTelegram import send_message
def main():
cancionVieja = ""
artistaViejo = ""
grabar()
while True:
try:
cancion, artista = averiguarCancion()
if cancion == "No se pudo reconocer la cancion":
time.sleep(30)
grabar()
continue
if cancion == cancionVieja and artista == artistaViejo:
time.sleep(60)
grabar()
continue
agregarCancion(cancion, artista)
text = armarTwit(cancion, artista)
escribirTweet(text)
cancionVieja = cancion
artistaViejo = artista
except:
continue
if __name__ == "__main__":
main()