cambiado hek por ipinfo.io

This commit is contained in:
2023-10-18 13:51:57 +02:00
parent 70bc043600
commit 0411c8a90a
2 changed files with 3 additions and 27 deletions

View File

@@ -1,11 +1,10 @@
import hek
from os.path import exists
import requests
from time import sleep
while True:
# get ip
ip = hek.ipstuff.myip(find="query")
req = requests.get("http://ipinfo.io/ip")
ip = req.text
# existe archivo con la antigua ip
file_exists = exists("old_ip.txt")
@@ -29,4 +28,4 @@ while True:
"CQhKyt_TA5uoaJhC_XE/sendMessage?chat_id=3058130&text="
"La nueva Ip para su Raspberry es: " + ip
)
sleep(5*60)
sleep(5 * 60)