waiterForIpChanged

CheckIpFoRpRoxy

  1. // ==UserScript==
  2. // @name waiterForIpChanged
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-01-04
  5. // @description CheckIpFoRpRoxy
  6. // @author MeGa
  7. // @match https://api.ipify*
  8. // @match http://api.ipify.org/
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=blsspainglobal.com
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13.  
  14. /***************************************************************************بسم الله الرحمن الرحيم***********************************************************************************/
  15.  
  16. //waiterForIpChanged
  17. if((localStorage.getItem("Ip_Modem_Lte_Home_MeGa")==null)){localStorage.setItem("Ip_Modem_Lte_Home_MeGa","");}
  18. var waiterForIpChanged=setInterval(function(){
  19. var XHR = new XMLHttpRequest();
  20. XHR.open("GET","https://api.ipify.org", true);
  21. XHR.onreadystatechange = function () {
  22. if (XHR.readyState == 4 && XHR.status == 200) {
  23. var RespTxt = XHR.responseText;
  24. console.log(RespTxt);
  25. if((localStorage.getItem("Ip_Modem_Lte_Home_MeGa")!==null) && (localStorage.getItem("Ip_Modem_Lte_Home_MeGa") !== RespTxt))
  26. {localStorage.setItem("Ip_Modem_Lte_Home_MeGa",RespTxt) ;
  27. envoyerNotificationTelegram("Modem_Lte_Home_MeGa got New ip : "+RespTxt)
  28. }
  29. }
  30. };
  31. XHR.send();
  32. },5000);
  33.  
  34.  
  35.  
  36.  
  37. // Declaration Telegram function
  38. function envoyerNotificationTelegram(message) {
  39. const TOKEN = '6476022733:AAHRGWEdShKPp-H6O_xLuqZdt4JSspeHLmQ'; // Remplacez par votre token de profil actuel
  40. const CHAT_ID = '-1001995942562'; // Remplacez par votre chat ID
  41.  
  42. const url = `https://api.telegram.org/bot${TOKEN}/sendMessage`;
  43. const data = {
  44. chat_id: CHAT_ID,
  45. text: message,
  46. };
  47.  
  48. fetch(url, {
  49. method: 'POST',
  50. headers: {
  51. 'Content-Type': 'application/json',
  52. },
  53. body: JSON.stringify(data),
  54. })
  55. .then(response => response.json())
  56. .then(data => console.log(data))
  57. .catch(error => console.error('Erreur:', error));
  58. }
  59.