Created
June 19, 2016 16:06
-
-
Save paspo/571638e8057d2ae77d08c11785640443 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from fritzconnection import FritzConnection | |
import telepot | |
import re | |
connection = FritzConnection(password='YOUR_FROTS_PASSWORD') | |
ip = connection.call_action('WANPPPConnection', 'GetInfo')['NewExternalIPAddress'] | |
match = re.search('^100\.', ip) | |
if match: | |
bot = telepot.Bot('TELEGRAM_BOT_TOKEN'); | |
bot.sendMessage('@TELEGRAM_GROUP', 'I\'ve got IP: %s and I don\'t like it.' % ip) | |
connection.reconnect() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment