waiterForIpChanged

CheckIpFoRpRoxy

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

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

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 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));
}