Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SET KEY=1234567890qwerty
- SET CITY=625144
- curl "http://api.openweathermap.org/data/2.5/weather?id=%CITY%&APPID=%KEY%&units=metric&mode=xml" -o weather.xml
- FOR /F "delims=" %%A IN ('xidel weather.xml -e "//current/visibility/@value" --output-format=^cmd') DO %%A
- SET VISI=%RESULT%
- IF %VISI% LEQ 500 (SET MODE=close) ELSE (SET MODE=open)
- echo ^<?xml version="1.0" encoding="UTF-8"?^> > ircut.xml
- echo ^<IrLightSwitch version="2.0" xmlns="http://www.std-cgi.com/ver20/XMLSchema"^> >> ircut.xml
- echo ^<mode^>%MODE%^</mode^> >> ircut.xml
- echo ^</IrLightSwitch^> >> ircut.xml
- curl --digest -X PUT -T ircut.xml "http://user:password@ip/ISAPI/System/Hardware/irLightSwitch"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement