Automatic portfolio created from Instagram tags

Hey there!

Recently my SO had that idea to try her strengths in make-up industry. Details aside, she needed some IT to promote her business and that’s where I come in. I created a website, loaded some Bootstrap theme that included nice portfolio (I’m no frontend guy, any interaction with JS/CSS is a no-no for me), and this portfolio had to be populated with actual images. For us to save the work I wrote an ASP.NET code which pulls image data from Azure Table storage, and injects it into view. I decided to use Flow to actually put the data from Instagram to Table storage.

For her clients she makes a photo of before and after – to see the actual difference make-up can do. Every time she posts a photo to Instagram with specific tag, Flow pulls the photo to Azure Table storage, where in turn website queries it and displays photos. you can see the end result here (mind you, some photos are not yet replaced, work in progress 😉 ):

Lyada Website – Makeup

The tags we agreed to use is #LyadaDaily, for all the occasional photos, #LyadaWedding, where she would do the make-up for brides, and #LyadaArt, where the make-up is advanced and serves rather theatrical purpose. This is how it looks on the website:

Screenshot-2018-2-28 Lyada Make-up - mobilna wizażystka Warszawa z dojazdem do klienta

The flow itself is triggered with new Instagram Media:

Screenshot-2018-2-28 Edit your flow Microsoft Flow(1)

Afterwards, the ID of uploaded media is used in activity “Get my recent media”. This retrieves all recent objects, as I want to use this opportunity to update the previous posts as well (I need to update the “Likes” count, to show only top works on website).

Screenshot-2018-2-28 Edit your flow Microsoft Flow(2)

The condition tree is built that way because so far Flow does not support a Switch statement that would simply this task. Right now each condition looks for text matching a specific tag, and processes this entry into Azure Table. If the content doesn’t match, a second and then third condition is evaluated.

Finally, “Insert or Merge entity” is used. I have had to spend some time figuring that one out, but it finally worked. In the Azure Table storage, I chose the PartitionKey \ ID primary key constraints, as these are going to be rather unique. Screenshot-2018-2-28 Edit your flow Microsoft Flow(3)

That aside, if you are not familiar with Flow from Microsoft, check it out on – for non-Office users there is a free tier, which allows for 750 Flow runs per month, with polls (triggers) every 15 minutes.

If you’ve had any troubles with it, let me know and maybe I can help out 🙂

~Alex Pawlak


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s