Well, it took many hours and dozens of trials, but I figured it out. Actually, I figured it out and then some!
My solution, thanks to @samliew’s suggestion, was to write data out to new rows in a Google Sheet and then pull that data back in to write the Markdown and HTML, and then clear the sheet’s contents after each successful run.
A few tricky bits
- The Instagram modules are separate for posts with a single image or video and posts with multiple items. The only way I could work out to account for both was to use several routers with filters. This meant a lot of duplicated modules, but at least it’s very clear about what’s happening.
- Variable contents kept getting reused when multiple posts were processed in the same go, so I ended up renaming them depending on which route they are on. I also did a ‘Set Multiple Variables’ module at the end of Row 3 which sets the variables to be blank, although I’m not sure if that’s necessary. It’s working, so I’m not going to bother changing it.
- Getting the Iterator set to the right source module was an exercise in patience. In the end, I figured out it needed to be the ‘Get Album Media’ module.
Extra AI fun
Since I was storing data per image upload anyway, I figured I would experiment with OpenAI’s Vision API module to create Alt Text for each of the images. Here is the prompt that I wrote (stored in the vision_api_prompt
variable at the beginning and reused in both routes):
Please provide a functional, objective description of the image in no more than around 30 words so that someone who could not see it would be able to imagine it. If possible, follow an “object-action-context” framework: The object is the main focus. The action describes what’s happening, usually what the object is doing. The context describes the surrounding environment.
If there is text in the image, please include that verbatim (without extra line breaks), even if it extends the word count beyond 30 words. If there is no text, there is no need to mention it.
It does a great job! For example, here’s a photo it analyzed:
And the alt text it generated:
A pile of opened packages and respiratory N95 masks rests on a table, suggesting recent unpacking or sorting, in an indoor setting. The text on packaging includes “PRIORITY MAIL” and “STANLEY personal protection N95 Disposable Respirator.”
Some Module Settings
Sharing
I’m pretty new to Make.com, so I don’t know if there’s an easy way to share blueprints without including sensitive data like access to my Instagram account, or my API keys for OpenAI or Micro.blog, but if anyone wants help with replicating this scenario, please let me know!
And if you have suggestions on how to simplify or improve this scenario, I’m all ears.
I’ll probably be sharing more about how I put this together on my blog soon, and you’ll be able to see it in action on my microblog/Mastodon.