{"id":30854,"date":"2023-12-11T17:10:18","date_gmt":"2023-12-11T22:10:18","guid":{"rendered":"https:\/\/ckms.ca\/?p=30854"},"modified":"2023-12-20T18:11:44","modified_gmt":"2023-12-20T23:11:44","slug":"how-i-use-chatgpt-to-make-a-simple-script-to-fetch-pics-from-the-ship-my-mother-is-on","status":"publish","type":"post","link":"https:\/\/blog.ckms.ca\/?p=30854","title":{"rendered":"how i use chatgpt to make a simple script to fetch pics from the ship my mother is on"},"content":{"rendered":"\n<p>mom &amp; larry are on the Norwegian Encore for a <a rel=\"noreferrer noopener\" href=\"https:\/\/www.ncl.com\/ca\/en\/cruises\/7-day-caribbean-round-trip-miami-great-stirrup-cay-and-dominican-republic-ENCORE7MIAPOPSTTTOVNPIMIA?embarkationport=4294949427&amp;sailMonths=4294949374&amp;ships=4294949365&amp;numberOfGuests=4294949461&amp;sortBy=featured&amp;autoPopulate=f&amp;from=resultpage&amp;itineraryCode=ENCORE7MIAPOPSTTTOVNPIMIA\" target=\"_blank\">7-day carribian cruise<\/a>.  the ship has a camera looking out the front, <a href=\"https:\/\/www.ncl.com\/shipcams\/encorecam\/fullsize.jpg\" target=\"_blank\" rel=\"noreferrer noopener\">updated every 10 minutes<\/a>:<\/p>\n\n\n\n<p><a href=\"https:\/\/blog.ckms.ca\/?p=31077\" data-type=\"post\" data-id=\"31077\" target=\"_blank\" rel=\"noreferrer noopener\">for reasons<\/a>, I want to capture this picture ever 15 minutes, and will likely make a video of the whole trip.  for reasons.<\/p>\n\n\n\n<p>should be easy with <code>wget<\/code> and a batch file (windows <code>.cmd<\/code>) that loops, pausing for 10 minutes.  save the files with an iso8601 appended<\/p>\n\n\n\n<p>here&#8217;s the <a href=\"https:\/\/chat.openai.com\/share\/eea633dd-14c9-49af-ac3a-b63bfb6d4776\" target=\"_blank\" rel=\"noreferrer noopener\">ChatGPT I used to create such a script<\/a>.  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&#8217;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&#8217;t grow well; both of these should be linked to&#8230;??).<br><br>the only problem with the original script was the required &#8220;call&#8221; to <code>wget<\/code> instead of running it directly; not sure why this is required, but it works, so \u00af_(\u30c4)_\/\u00af (note first use of <a rel=\"noreferrer noopener\" href=\"https:\/\/blog.ckms.ca\/?p=26859#text-blaze\" data-type=\"post\" target=\"_blank\">Text Blaze extension<\/a>, <code>^\/wv -><\/code> \u00af_(\u30c4)_\/\u00af (<s>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.<\/s>))<\/p>\n\n\n\n<p>here&#8217;s the completed script:<\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:10px\"><code>C:\\Users\\csilvest\\utilities&gt;type image-getter.cmd\n@echo off\n\n:LOOP\n\nREM Get current date and time in ISO 8601 format\n\nfor \/f \"tokens=2 delims==\" %%I in ('wmic os get localdatetime \/value') do set datetime=%%I\nset isodate=%datetime:~0,4%-%datetime:~4,2%-%datetime:~6,2%-%datetime:~8,2%-%datetime:~10,2%-%datetime:~12,2%\n\nREM Set the URL and filename\n\nset url=https:\/\/www.ncl.com\/shipcams\/encorecam\/fullsize.jpg\nset filename=image_%isodate%.jpg\n\nREM Use wget to retrieve the image\n\ncall wget %url% -O %filename%\n\nREM Wait for 10 minutes (600 seconds) before looping\n\ntimeout \/t 600\n\ngoto LOOP<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe loading=\"lazy\" title=\"norwegian encore mom larry cruise 2023 12~\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/UcTxMX8j1WY?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<p>sadly, as mentioned at the end of the video, the images stopped updating on Tuesday morning.  So didn&#8217;t get the whole trip.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>mom &amp; larry are on the Norwegian Encore for a 7-day carribian&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[282],"tags":[157,1697,664,1657,140],"class_list":["post-30854","post","type-post","status-publish","format-standard","hentry","category-article","tag-boat-ish","tag-chatgpt","tag-cruising","tag-how-i","tag-paul","wpcat-282-id"],"_links":{"self":[{"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=\/wp\/v2\/posts\/30854","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=30854"}],"version-history":[{"count":10,"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=\/wp\/v2\/posts\/30854\/revisions"}],"predecessor-version":[{"id":31098,"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=\/wp\/v2\/posts\/30854\/revisions\/31098"}],"wp:attachment":[{"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=30854"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=30854"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ckms.ca\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=30854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}