waiterForIpChanged

CheckIpFoRpRoxy

您需要先安装一个扩展,例如 篡改猴Greasemonkey暴力猴,之后才能安装此脚本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安装一个扩展,例如 篡改猴暴力猴,之后才能安装此脚本。

您需要先安装一个扩展,例如 篡改猴Userscripts ,之后才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。

您需要先安装用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         waiterForIpChanged
// @namespace    http://tampermonkey.net/
// @version      2024-01-04
// @description  CheckIpFoRpRoxy
// @author       MeGa
// @match        https://api.ipify*
// @match        http://api.ipify.org/
// @icon         https://www.google.com/s2/favicons?sz=64&domain=blsspainglobal.com
// @grant        none
// ==/UserScript==


/***************************************************************************بسم الله الرحمن الرحيم***********************************************************************************/

//waiterForIpChanged
if((localStorage.getItem("Ip_Modem_Lte_Home_MeGa")==null)){localStorage.setItem("Ip_Modem_Lte_Home_MeGa","");}
var waiterForIpChanged=setInterval(function(){
var XHR = new XMLHttpRequest();
        XHR.open("GET","https://api.ipify.org", true);
        XHR.onreadystatechange = function () {
          if (XHR.readyState == 4 && XHR.status == 200) {
            var RespTxt = XHR.responseText;
           console.log(RespTxt);
              if((localStorage.getItem("Ip_Modem_Lte_Home_MeGa")!==null) && (localStorage.getItem("Ip_Modem_Lte_Home_MeGa") !== RespTxt))
              {localStorage.setItem("Ip_Modem_Lte_Home_MeGa",RespTxt) ;
               envoyerNotificationTelegram("Modem_Lte_Home_MeGa got New ip :  "+RespTxt)
              }
                        }
        };
        XHR.send();
},5000);




// Declaration Telegram function
function envoyerNotificationTelegram(message) {
        const TOKEN = '6476022733:AAHRGWEdShKPp-H6O_xLuqZdt4JSspeHLmQ'; // Remplacez par votre token de profil actuel
        const CHAT_ID = '-1001995942562'; // Remplacez par votre chat ID

        const url = `https://api.telegram.org/bot${TOKEN}/sendMessage`;
        const data = {
            chat_id: CHAT_ID,
            text: message,
        };

        fetch(url, {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
            },
            body: JSON.stringify(data),
        })
        .then(response => response.json())
        .then(data => console.log(data))
        .catch(error => console.error('Erreur:', error));
}