Weather in Batch File

by Thisismyusername in Circuits > Microsoft

628 Views, 0 Favorites, 0 Comments

Weather in Batch File

Screenshot 2023-07-21 110726.png

Made in batch

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

DIY WEATHER INFO

\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

Copy Code

Here is the code

==============================================

@echo off

title Weather

color 03

cls

:begin

cls

echo         W  W  W  EEEEE    A    TTTTTTTT HH  HH EEEEEEE RRRRRR

echo         WWW WWW WWW  EEE     A A     TT   HH  HH EEE   RR  R

echo         WWWWW WWWWW  EEEEE   AAAAA    TT   HHHHHHHH EEEEEEE RRRRRRR

echo         WWW  WWW  EEE    A   A    TT   HH  HH EEE   RR  RR

echo          W   W   EEEEE  A    A   TT   HH  HH EEEEEEE RR  RR

echo.

echo.

echo                      =-----------=

echo                      1) In-Batch

echo                       2) Web

echo                        3) Exit

echo                      =-----------=

set /p op=.                       User:

if "%op%"=="1" goto op1

if "%op%"=="2" goto op2

if "%op%"=="3" goto op3


echo Please Select

goto begin


:op1

:refresh

cls

set City=::[Input Your City Here]


set City_=%City: =-%

for /f "Delims=" %%a in ('curl --silent wttr.in/%City_%?format^=%%t') do set "CTemperature=%%a"

set CTemperature=%CTemperature:+=%

set CTemperature=%CTemperature:~0,-3%

for /f "skip=1 tokens=4*" %%a in ('curl --silent wttr.in/%City_%?0') do set "Description=%%a %%b"& goto :Next

:Next

echo                                  [//////////////]

echo                                    =%City%=

echo                     ////////////////////////////////////////////////////////////////////////////

echo.

echo                          %CTemperature%*Celsius   "%Description%"

echo.

echo                      ///////////////////////////////////////////////////////////////////////////

echo.

echo                                    -======-

echo                                    1)Refresh

echo                                    2)Exit

echo                                    -======-

echo                     [___________________________________________________________________________]

set /p op=.                                Select:

if "%op%"=="1" goto refresh

if "%op%"=="2" goto begin


echo Please Select

goto refresh



:op2

cls

Start ::[Input Your Browser] ::[Input Your weather website Here]

goto begin


:op3

cls

echo                       ????

echo                      ???? ????

echo                         ???

echo                         ???

echo                        ???

echo                        ???

echo.

echo                        ???

echo.

echo.

echo                  You want to leave, already?

echo                       -======-

echo                       1)Go back

echo                       2)Leave

echo                       -======-

set /p op=.                   Select:

if "%op%"=="1" goto begin

if "%op%"=="2" goto exit


echo Please Select

goto op3


:exit

exit

=========================================

Note : copy and paste into the notepad and save as Weather.bat , click all files AND your done!

Replace the Inputs

Please Replace : [Input Your Browser],[Input Your weather website Here],[Input Your City Here]