how i use chatgpt to make a simple script to fetch pics from the ship my mother is on

mom & larry are on the Norwegian Encore for a 7-day carribian cruise. the ship has a camera looking out the front, updated every 10 minutes:

for reasons, I want to capture this picture ever 15 minutes, and will likely make a video of the whole trip. for reasons.

should be easy with wget and a batch file (windows .cmd) that loops, pausing for 10 minutes. save the files with an iso8601 appended

here’s the ChatGPT I used to create such a script. admittedly this is pretty simple, and I could whip something like this up in ~15 minutes (less if I can find the numberous other times I’ve created such scripts (ex. capturing pics of backyard while excavator or bobcat in use, and the investigating the reason the back fence cedars don’t grow well; both of these should be linked to…??).

the only problem with the original script was the required “call” to wget instead of running it directly; not sure why this is required, but it works, so ¯_(ツ)_/¯ (note first use of Text Blaze extension, ^/wv -> ¯_(ツ)_/¯ (now need link to Text Blaze and add to list of chrome extensions I highly recommend; also now I want this Text Blaze everywhere, way better than windows text replacement.))

here’s the completed script:

C:\Users\csilvest\utilities>type image-getter.cmd
@echo off

:LOOP

REM Get current date and time in ISO 8601 format

for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /value') do set datetime=%%I
set isodate=%datetime:~0,4%-%datetime:~4,2%-%datetime:~6,2%-%datetime:~8,2%-%datetime:~10,2%-%datetime:~12,2%

REM Set the URL and filename

set url=https://www.ncl.com/shipcams/encorecam/fullsize.jpg
set filename=image_%isodate%.jpg

REM Use wget to retrieve the image

call wget %url% -O %filename%

REM Wait for 10 minutes (600 seconds) before looping

timeout /t 600

goto LOOP

sadly, as mentioned at the end of the video, the images stopped updating on Tuesday morning. So didn’t get the whole trip.

Leave a Reply