Quantcast
Channel: Active questions tagged windows - Super User
Viewing all articles
Browse latest Browse all 8949

Easy Way to Check Internet Subscription Expiry?

$
0
0

This website helps me check and manage my internet subscription expiration easily. I typically visit 'https://client.algerietelecom.dz/en/login' and log in before navigating to 'https://client.algerietelecom.dz/en/accueil' to find the expiration date. However, this process involves a lot of clicking, so I've created a batch file with the help of ChatGPT and the 'CurlWget' extension (available at "https://chromewebstore.google.com/detail/curlwget/dgcfkhmmpcmkikfmonjcalnjcmjcjjdn"). Now, with just one click on the batch file, I can instantly view the expiration date.

The problem I face is that I need to update the cookie every few hours, obtained from the 'CurlWget' extension, or else the wget command fails. I'm seeking a more efficient method to obtain the date where I can simply click the batch file and wait without the need for frequent updates. :)

@echo offtitle netDate.bat:: Change the current directory to the location of the batch filecd %~dp0:: Initialize variables to store date output and output file pathset "dateOutput="set "outputFile=%~dp0%~n0.txt":: Check if the output file exists and delete it if it doesif exist "%outputFile%" (    echo Deleting existing output file: "%outputFile%"    del "%outputFile%"):: Use CurlWget to generate 'curl' or 'wget' commands for console-only sessions.:: Add the extension "https://chromewebstore.google.com/detail/curlwget/dgcfkhmmpcmkikfmonjcalnjcmjcjjdn" to your browser.:: Download the desired website and copy the generated command from the extension.:: Wget command to download website content and store it in the specified output filewget --header="Host: client.algerietelecom.dz" --header="User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36" --header="Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8" --header="Accept-Language: en-US,en;q=0.9" --header="Referer: https://client.algerietelecom.dz/en" --header="Cookie: XSRF-TOKEN=eyJpdiI6IjlvQ0M1QzFaVmlxbDNnMzRBb3J1VFE9PSIsInZhbHVlIjoiWURvckZ0Q3pLemUyRytVV3RFNHNsaWNwenFOcitUZHNTdkRPc1VVTlUvUG5GNUJqU0k2enpzY0xaQ1dwTWkrTXhJc1JUQ1pYakRzV0U2MC8xL1JxRFFCMENYb1ViYkVrRVhPL1ZPcEsydTRyTUJzbnhhZkpWZGZXYWFCYmFTUnciLCJtYWMiOiI3NWRlZjM1NmQwOGVjN2FlMmNiZWY5NDE4ZTZiNzczZTBjNGNkMTYyYTY1MWE2MWZlOTIzZDhmOTBiNWZhM2EzIn0%%3D; algerietelecom_session=eyJpdiI6IjlXM0JwMWhTZ3RjQ2hTN0paSFlCQWc9PSIsInZhbHVlIjoibXRVNnJGR3hxZEVjWmdSWkpVWHk5M3BINmFZOGlkL2ZYeVpzRnZuTG1BT2h5Z1A2K0ZwUG56d0Vjci9OUlV4dVl0RVY4bzVDLzRibEViZi9VK0VmM1BQSVd0THZ2ZTlDMHBmS01SNndOanJQcyt0d2NzUEtPRlBaZ1BjSTFncXIiLCJtYWMiOiI4MGQzZDdmNTc3ZmRkMGQzYWZiYWRhMDRjOGJiOGEzMTQ3ZDY3N2M2MGIzMWM5OWVjMzgxMTI4MWQ4OTJmYjdkIn0%%3D; TS013c68a0=012ff2920eca0405d30cac104fb3d4ecc5cfc7918a03af7de489efccd4117d2f0b1ce98422101357bce4897514d05209d09f24452f07195135791f2d9b483f4d44a1ababbfe1b9432b463a42f1d8dc57cec824e8d2" --header="Connection: keep-alive" "https://client.algerietelecom.dz/en/accueil" -c -O "%outputFile%" >nul 2>&1:: Use Perl to extract the date from the downloaded content and set it to 'dateOutput'for /f "delims=" %%a in ('perl -ne "print /(\d{2}-\d{2}-\d{4})/ if /(\d{2}-\d{2}-\d{4})/" "%outputFile%"') do (    set "dateOutput=%%a"    if not defined dateOutput (        echo Error: Failed to retrieve expiration date from the downloaded content.        Pause        exit /b 1    )):: Display the extracted date and pause the scriptecho Internet expires after "%dateOutput%".Pause

Viewing all articles
Browse latest Browse all 8949

Trending Articles