In order to use this PHP snippet you need to have:
- a working BOT for telegram. (add @BotFather to your telegram and follow the instructions to create your bot and acquire the API TOKEN).
- A Telegram API TOKEN ( see previous point)
- The chat ID of your conversation with the BOT.
You can get it from here: https://api.telegram.org/bot{REPLACE WITH YOUR BOT API TOKEN}/getUpdates ex. https://api.telegram.org/bot9345924:5TGnkslav03anmsclakzXc/getUpdates
Place the snippet in the pace you would like to track and change the value of the variables: $token and $chat_id with your values.
Enjoy.
If someone asks why whould I like to have a notifier for the visits of my website. Well, I've been under hacker attack recently and to know the IP of the attacker at the moment of the attack was quite useful.