Skip to content

Instantly share code, notes, and snippets.

@paspo
Created June 19, 2016 16:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paspo/571638e8057d2ae77d08c11785640443 to your computer and use it in GitHub Desktop.
Save paspo/571638e8057d2ae77d08c11785640443 to your computer and use it in GitHub Desktop.
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