<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 99littlebugs</title>
    <description>The latest articles on DEV Community by 99littlebugs (@99littlebugs).</description>
    <link>https://dev.to/99littlebugs</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F644717%2F50b47548-7301-4052-8195-1aa55a3f6132.png</url>
      <title>DEV Community: 99littlebugs</title>
      <link>https://dev.to/99littlebugs</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/99littlebugs"/>
    <language>en</language>
    <item>
      <title>Automatic Data Updates for Static Websites</title>
      <dc:creator>99littlebugs</dc:creator>
      <pubDate>Tue, 23 Nov 2021 16:03:25 +0000</pubDate>
      <link>https://dev.to/99littlebugs/automatic-data-updates-for-static-websites-1gdl</link>
      <guid>https://dev.to/99littlebugs/automatic-data-updates-for-static-websites-1gdl</guid>
      <description>&lt;h3&gt;
  
  
  My Workflow
&lt;/h3&gt;

&lt;p&gt;On Sunday, January 10th, 2020, teachers had just became eligible for the COVID-19 vaccine but finding an appointment was tough. Each NY state location had its own sign-up link, and people were cycling through their list every couple of minutes hoping that availability would open. As a developer, I wondered whether I'd be able to help by creating a single pane of glass that would show availability for many locations at a glance. &lt;/p&gt;

&lt;p&gt;I wanted something simple, was excited by static sites and serverless and did some fast research on how I could string these concepts together to create an auto-updating website of vaccine appointment availability. I found some tutorials that showed developers scraping websites and then committing the data back to a git repository and knew that’s what I would try first. I told myself that if I could get the data scraping done on that first night then this was a problem worth more of my time. &lt;/p&gt;

&lt;p&gt;I used &lt;a href="https://cheerio.js.org/index.html"&gt;cheerio&lt;/a&gt; for the website scraping and wrote the collected data out to a file. Then I used &lt;a href="https://docs.github.com/en/actions"&gt;GitHub actions&lt;/a&gt; on a 15 minute &lt;a href="https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#schedule"&gt;cron job schedule&lt;/a&gt; to &lt;a href="https://github.com/marketplace/actions/checkout"&gt;checkout&lt;/a&gt; the repo, run the scraper script, and commit the data back. In 24 lines of yaml, and 55 lines of JavaScript, I had an automatic data scraper. I was satisfied with my progress and well on my way. &lt;/p&gt;

&lt;h3&gt;
  
  
  Submission Category:
&lt;/h3&gt;

&lt;p&gt;DIY Deployments&lt;/p&gt;

&lt;h3&gt;
  
  
  Code
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://github.com/99littlebugs/vaccine-site-finder/tree/80a8a0f2039da5a2ff78d302442b6bb24cb3df57"&gt;Full source code&lt;/a&gt;, which is linked to the last code commit on January 10th.&lt;br&gt;
Particular attention should be given to &lt;code&gt;/.github/workflows/scrape.yml&lt;/code&gt; (&lt;a href="https://github.com/99littlebugs/vaccine-site-finder/blob/80a8a0f2039da5a2ff78d302442b6bb24cb3df57/.github/workflows/scrape.yml"&gt;link&lt;/a&gt;) and &lt;code&gt;scraper.js&lt;/code&gt; (&lt;a href="https://github.com/99littlebugs/vaccine-site-finder/blob/80a8a0f2039da5a2ff78d302442b6bb24cb3df57/scraper.js"&gt;link&lt;/a&gt;). &lt;/p&gt;

&lt;h3&gt;
  
  
  Additional Resources / Info
&lt;/h3&gt;

&lt;p&gt;Inspiration for this pattern is listed in the repo's &lt;a href="https://github.com/99littlebugs/vaccine-site-finder/tree/80a8a0f2039da5a2ff78d302442b6bb24cb3df57#readme"&gt;README&lt;/a&gt; file. &lt;/p&gt;

</description>
      <category>actionshackathon21</category>
      <category>githubactions</category>
      <category>jamstack</category>
    </item>
    <item>
      <title>Ordering photos and videos for a slideshow or montage</title>
      <dc:creator>99littlebugs</dc:creator>
      <pubDate>Sun, 06 Jun 2021 16:34:02 +0000</pubDate>
      <link>https://dev.to/99littlebugs/ordering-photos-and-videos-for-a-slideshow-or-montage-2dd7</link>
      <guid>https://dev.to/99littlebugs/ordering-photos-and-videos-for-a-slideshow-or-montage-2dd7</guid>
      <description>&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;Ordering photos so that when imported from a  Windows PC to an iPad (or other tool) they would be in the right order. The end goal was to import them into a slideshow app already in the required order. &lt;/p&gt;

&lt;h3&gt;
  
  
  Mistake #1 - renaming in Google Drive
&lt;/h3&gt;

&lt;p&gt;I received the photos via email and had imported them directly to Google Drive using the button in Gmail. I then renamed them with a number prefix so that they would alphabetize to the order that I wanted.&lt;/p&gt;

&lt;p&gt;When I was ready to start compiling, I downloaded the whole folder to my computer. But they had the original filenames! After some researching, I found that Gmail automatically used an "Image Link" when importing. This meant that I had renamed the link instead of renaming the actual file. &lt;/p&gt;

&lt;h3&gt;
  
  
  Discovering Google Colaboratory
&lt;/h3&gt;

&lt;p&gt;There was little to nothing on Google about my specific issue and "Image Links" in general, but I discovered a &lt;a href="https://webapps.stackexchange.com/a/141694"&gt;similar problem&lt;/a&gt; for a shared folder. One of the responses there suggested using &lt;a href="https://colab.research.google.com/"&gt;Google Colaboratory&lt;/a&gt; which with these two snippets, worked perfectly.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from google.colab import drive
drive.mount('/gdrive')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;!cp -r '/gdrive/My Drive/OriginalFolder/.' '/gdrive/My Drive/NewFolder'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This copied over all the files from &lt;code&gt;OriginalFolder&lt;/code&gt; to &lt;code&gt;NewFolder&lt;/code&gt; within Google Drive. &lt;/p&gt;

&lt;h3&gt;
  
  
  Using ExifTool
&lt;/h3&gt;

&lt;p&gt;Now that I had the files on my computer and in the right order, I still needed a way to load them to the iPad with the correct ordering. Some of the photos had the &lt;code&gt;Date Taken&lt;/code&gt; file metadata which is what the iPad uses for ordering. &lt;/p&gt;

&lt;p&gt;Lots of online resources pointed to using &lt;a href="https://exiftool.org/"&gt;ExifTool&lt;/a&gt; for cleaning up that metadata and rjames86's &lt;a href="https://gist.github.com/rjames86/33b9af12548adf091a26#set-datetimeoriginal-to-any-arbitrary-timestamp"&gt;exiftool cheatsheet&lt;/a&gt; taught me to set all the file dates to an arbitrary time with this command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;exiftool.exe -r "-AllDates=2021:06:05 14:00:00" "C:\Path\To\Folder"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I was optimistic that since all the timestamps were now the same, the iPad would resort to ordering alphabetically by filename. I had been using the Files app for importing from Google Drive and the files still weren't coming in 100% in the right order, though they did now have the expected arbitrary date and time set.&lt;/p&gt;

&lt;p&gt;What I really needed was a way to set the timestamps to be ordered in the order  of the files on my computer. That would be foolproof for ensuring that they loaded in properly. But how to use ExifTool for that? I thought about scripting it myself but didn't really have the time. Thankfully, I found &lt;a href="https://photo.stackexchange.com/a/60403"&gt;instructions&lt;/a&gt; for using ExifTool with the &lt;code&gt;filesequence&lt;/code&gt; variable once the files already all have the same time.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;exiftool.exe -r "-AllDates+&amp;lt;0:0:${filesequence}0" "C:\Path\To\Folder"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Voila! This worked great. At this point, I also realized that I could've and should've been using iTunes and a cable to sync a folder to the iPad, rather than waiting for upload, download, and then import from Google Drive.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd do next time
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Ordering via renaming locally instead of on Google Drive&lt;/li&gt;
&lt;li&gt;Use exiftool for the incremental arbitrary timestamping&lt;/li&gt;
&lt;li&gt;Use iTunes and a cable to sync the photos to iPad instead of through the internet&lt;/li&gt;
&lt;/ul&gt;

</description>
    </item>
  </channel>
</rss>
