<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Digital Insanity Magazine by Bruno Amaral</title>
		<link>https://brunoamaral.eu/tags/geek/</link>
		<description>The creative escape of Bruno Amaral</description>
		<generator>Hugo -- gohugo.io</generator>
		<language>en-us</language>
		<copyright>Bruno Amaral 2019</copyright>
		<lastBuildDate>Thu, 25 Jun 2020 13:35:26 +0100</lastBuildDate>
		<image>
			<url>https://brunoamaral.eu/static/logo_blue_small.png</url>
			<title>Digital Insanity Magazine</title>
			<link>https://brunoamaral.eu/tags/geek/</link>
		</image>
		
		<atom:link href="https://brunoamaral.eu/tags/geek/index.xml" rel="self" type="application/rss+xml" />
		
		
		<item>
			<title>Import Instagram Posts Into Hugo</title>
			<link>https://brunoamaral.eu/post/import-instagram-posts-into-hugo/</link>
			<pubDate>Thu, 25 Jun 2020 13:35:26 +0100</pubDate>
			
			<guid>https://brunoamaral.eu/post/import-instagram-posts-into-hugo/</guid>
			<description>
				
				
				
				<![CDATA[<img src="https://brunoamaral.eu/post/import-instagram-posts-into-hugo/images/_hu1775f9289df938ff5e9cabf70049987e_325511_d3a2ff40b9053978cf39b6a9b4b9dd57.jpg" width="640" height="427"/>]]>
				
				&lt;p&gt;I do love Instagram and the cool ways we can connect through with, see other cities, people we miss. It&amp;rsquo;s just hard to deal with having my photos kind of trapped there.&lt;/p&gt;
&lt;p&gt;It is possible to export them, but that process takes a while. So this last weekend I took some time to improve a script that I used to extract my photos from there and onto this site.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://brunoamaral.eu/instagram/&#34;&gt;They are in the pages of the Photos section.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Here is a step by step on what I did for those more tech-inclined.&lt;/p&gt;
&lt;p&gt;Some things to take into account before moving on:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;We are assuming the website is ran by &lt;a href=&#34;https://gohugo.io/&#34;&gt;Hugo&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;You need some knowledge in using the Command Line of your computer.&lt;/li&gt;
&lt;li&gt;Some of the information below includes what is useful for me, your needs will vary.&lt;/li&gt;
&lt;/ol&gt;





	&lt;aside class=&#34;pullquote separator  float-center&#34;&gt;
		If you just want a way to save your Instagram to your computer, I suggest you try &lt;a href=&#39;https://www.4kdownload.com/products/product-stogram&#39;&gt;4K Stogram&lt;/a&gt;. The method below is meant for a heavy extraction of files and data and for the specific use case of creating blog posts in &lt;a href=&#39;https://gohugo.io&#39;&gt;Hugo&lt;/a&gt; 
	&lt;/aside&gt;

&lt;h2 id=&#34;instaloader&#34;&gt;Instaloader&lt;/h2&gt;
&lt;blockquote class=&#34;blockquote&#34;&gt;
  &lt;p class=&#34;mb-0&#34;&gt;&lt;a href=&#34;https://instaloader.github.io/&#34;&gt;Instaloader is a tool to download pictures (or videos) along with their captions and other metadata from Instagram.&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;This command line tool does the heavy lifting, it authenticates you to Instagram, queries your profile and posts and saves everything to a nice file structure.&lt;/p&gt;
&lt;p&gt;What we are going to do is take those files, extract data from them, and save it as environment variables. Those will then be picked up by the Hugo Archetype we defined for new posts in that section.&lt;/p&gt;
&lt;h2 id=&#34;archetype-for-instagram-posts&#34;&gt;Archetype for Instagram Posts&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://gohugo.io/content-management/archetypes/#readout&#34;&gt;When you create new content, Hugo uses a template for that file. That template is called an Archetype&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;There are some Hugo functions you can use in these templates, and we are using &lt;code&gt;getenv&lt;/code&gt; that allows us to use environment variables in your new post.&lt;/p&gt;
&lt;p&gt;Take a look:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;&lt;span class=&#34;nn&#34;&gt;---&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;categories&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;date&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;{{&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;getenv &amp;#34;post_datetime&amp;#34;}}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;description&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;draft&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;kc&#34;&gt;false&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;resources&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;src&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;{{&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;getenv &amp;#34;post_image&amp;#34; }}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;name&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;header&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;layout&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;instagram&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;location&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;link&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;{{&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;getenv &amp;#34;google_maps_link&amp;#34;}}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;latitude&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;{{&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;getenv &amp;#34;latitude&amp;#34; }}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;  &lt;/span&gt;- &lt;span class=&#34;nt&#34;&gt;longitude&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;{{&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;getenv &amp;#34;longitude&amp;#34; }}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;stories&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;subtitle&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;title&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;{{ getenv &amp;#34;&lt;/span&gt;&lt;span class=&#34;l&#34;&gt;post_title&amp;#34; }}&amp;#34;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nt&#34;&gt;tags&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;{{&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;getenv &amp;#34;post_tags&amp;#34;}}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nn&#34;&gt;---&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&lt;/span&gt;{{&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;l&#34;&gt;getenv &amp;#34;post_content&amp;#34; }}&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;You can tweak this file to add more information, as long as you also do the same in the script that puts it all together. More on that later.&lt;/p&gt;
&lt;h2 id=&#34;import-and-update-script&#34;&gt;Import and update script&lt;/h2&gt;
&lt;p&gt;&lt;a href=&#34;https://github.com/brunoamaral/import-instagram-to-hugo&#34;&gt;The script became a little more complex than what was to be expected. To keep things in order, it&amp;rsquo;s hosted on GitHub&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;steps&#34;&gt;Steps&lt;/h3&gt;
&lt;ol&gt;
&lt;li&gt;Edit the config section of the script&lt;/li&gt;
&lt;li&gt;Run the setup with &lt;code&gt;./instagram-posts-from-instaloader.sh setup&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Execute the update &lt;code&gt;./instagram-posts-from-instaloader.sh run-update&lt;/code&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Running setup, you will be asked for your username and password. Instaloader will setup a directory with your username where it will store your photos alongside the metadata it found.&lt;/p&gt;
&lt;p&gt;We are keeping this directory untouched, read from it, and save the information we need as an environment variable. The full code is below and on GitHub.&lt;/p&gt;
&lt;p&gt;Inside the &lt;code&gt;update-post&lt;/code&gt; function we are reading the json data with &lt;code&gt;xzcat&lt;/code&gt; and &lt;code&gt;jq&lt;/code&gt;. If you want to add more data to the exported post, this is where you should look.&lt;/p&gt;
&lt;p&gt;After this is done, we check if the post exists and if not, run &lt;code&gt;hugo new ...&lt;/code&gt; and copy any jpg or video files that may be included.&lt;/p&gt;
&lt;p&gt;With this done, your new posts should be ready. Run &lt;code&gt;hugo server&lt;/code&gt; to make sure it&amp;rsquo;s working as you expected.&lt;/p&gt;
&lt;p&gt;If you wish to add or improve any bit of the script, feel free to submit a merge request on the GitHub page.&lt;/p&gt;
&lt;p&gt;Let me know in the comments if this was useful. 😀&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;cp&#34;&gt;#!/bin/zsh
&lt;/span&gt;&lt;span class=&#34;cp&#34;&gt;&lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;## USAGE&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;### 1. Run the setup with `./instagram-posts-from-instaloader.sh setup`&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;### 2. Execute the update `./instagram-posts-from-instaloader.sh run-update`&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;## Config&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;### Where is your blog located?&lt;/span&gt;
&lt;span class=&#34;nv&#34;&gt;blog&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;/Users/brunoamaral/Labs/Digital-Insanity&amp;#34;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;### What is your Instagram Username?&lt;/span&gt;
&lt;span class=&#34;nv&#34;&gt;instagramUser&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;brunoamaral&amp;#34;&lt;/span&gt;
&lt;span class=&#34;c1&#34;&gt;### Where are we saving the output from Instaloader? (do not include the username)&lt;/span&gt;
&lt;span class=&#34;nv&#34;&gt;directoryWithInstagramPosts&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;/Users/brunoamaral/Labs/instagram/&amp;#34;&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;### Where do you want photos saved to? Relative to ./content &lt;/span&gt;
&lt;span class=&#34;nv&#34;&gt;instagramdir&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;instagram&amp;#34;&lt;/span&gt;

&lt;span class=&#34;c1&#34;&gt;# Dependency check&lt;/span&gt;

&lt;span class=&#34;nb&#34;&gt;command&lt;/span&gt; -v instaloader &amp;gt;/dev/null 2&amp;gt;&lt;span class=&#34;p&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;||&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &amp;gt;&lt;span class=&#34;p&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;2&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;I require Instaloader but it&amp;#39;s not installed. Aborting.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;exit&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;nb&#34;&gt;command&lt;/span&gt; -v xzcat &amp;gt;/dev/null 2&amp;gt;&lt;span class=&#34;p&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;||&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &amp;gt;&lt;span class=&#34;p&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;2&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;I require xzcat but it&amp;#39;s not installed. Aborting.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;exit&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;nb&#34;&gt;command&lt;/span&gt; -v jq &amp;gt;/dev/null 2&amp;gt;&lt;span class=&#34;p&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;||&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &amp;gt;&lt;span class=&#34;p&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;2&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;I require jq but it&amp;#39;s not installed. Aborting.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;exit&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;
&lt;span class=&#34;nb&#34;&gt;command&lt;/span&gt; -v hugo &amp;gt;/dev/null 2&amp;gt;&lt;span class=&#34;p&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;||&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;{&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &amp;gt;&lt;span class=&#34;p&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;2&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;I require hugo but it&amp;#39;s not installed. Aborting.&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;nb&#34;&gt;exit&lt;/span&gt; &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;

setup&lt;span class=&#34;o&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;nb&#34;&gt;cd&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$directoryWithInstagramPosts&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; 
  instaloader --fast-update --geotags --login&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$instagramUser&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$instagramUser&lt;/span&gt;
&lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;

run-update&lt;span class=&#34;o&#34;&gt;(){&lt;/span&gt;
  find &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$directoryWithInstagramPosts&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$instagramUser&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; -maxdepth &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; -name &lt;span class=&#34;s1&#34;&gt;&amp;#39;*.json.xz&amp;#39;&lt;/span&gt;  -exec ./instagram-posts-from-instaloader.sh update-post &lt;span class=&#34;o&#34;&gt;{}&lt;/span&gt; &lt;span class=&#34;se&#34;&gt;\;&lt;/span&gt;
&lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;  &amp;gt;&lt;span class=&#34;p&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;

update-post&lt;span class=&#34;o&#34;&gt;()&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;{&lt;/span&gt;
  &lt;span class=&#34;nv&#34;&gt;file&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;basename &lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;nv&#34;&gt;dir&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;dirname &lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;nv&#34;&gt;imagefinal&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;file&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;//&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;json.xz&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;jpg&amp;#39;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;
  &lt;span class=&#34;nv&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;`&lt;/span&gt;xzcat &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; jq &lt;span class=&#34;s1&#34;&gt;&amp;#39;.node.edge_media_to_caption.edges[0].node.text&amp;#39;&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;`&lt;/span&gt;

  &lt;span class=&#34;nb&#34;&gt;declare&lt;/span&gt; -a tags&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
  &lt;span class=&#34;nv&#34;&gt;tags&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$content&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; grep -o &lt;span class=&#34;s1&#34;&gt;&amp;#39;#[[:alpha:]|[:alnum:]]*&amp;#39;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;nv&#34;&gt;jsontags&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;printf&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;%s&amp;#39;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;tags&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;[@]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; jq -R . &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; jq -s .&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;nv&#34;&gt;jsontags&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;jsontags&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;//[&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;$&amp;#39;\t\r\n&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;|&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;$&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;]&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;
  &lt;span class=&#34;nv&#34;&gt;jsontags&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;jsontags&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;//&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;#&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;
  &lt;span class=&#34;nv&#34;&gt;date&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;`&lt;/span&gt;cut -d&lt;span class=&#34;s1&#34;&gt;&amp;#39;_&amp;#39;&lt;/span&gt; -f &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$file&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;`&lt;/span&gt;
  &lt;span class=&#34;nv&#34;&gt;time&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;`&lt;/span&gt;cut -d&lt;span class=&#34;s1&#34;&gt;&amp;#39;_&amp;#39;&lt;/span&gt; -f &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$file&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;sb&#34;&gt;`&lt;/span&gt;

  &lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;post_image&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$imagefinal&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;
  &lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;post_datetime&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$date&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;T&amp;#34;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;time&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;//-/:&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;+00:00&amp;#34;&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;post_tags&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$jsontags&lt;/span&gt;
  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[[&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$content&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; null &lt;span class=&#34;o&#34;&gt;]]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;then&lt;/span&gt;
    &lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; post_slug
    &lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;post_title&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$date&lt;/span&gt;
    &lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;post_content&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34; &amp;#34;&lt;/span&gt;
  &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt;
    &lt;span class=&#34;nv&#34;&gt;slug&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;&lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$content&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt;  iconv -c -t ascii//TRANSLIT &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; sed -E &lt;span class=&#34;s1&#34;&gt;&amp;#39;s/[~\^]+//g&amp;#39;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; sed -E &lt;span class=&#34;s1&#34;&gt;&amp;#39;s/[^a-zA-Z0-9]+/-/g&amp;#39;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; sed -E &lt;span class=&#34;s1&#34;&gt;&amp;#39;s/^-+\|-+$//g&amp;#39;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; sed -E &lt;span class=&#34;s1&#34;&gt;&amp;#39;s/-$//g&amp;#39;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; tr A-Z a-z &lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
    &lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;post_slug&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;slug&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;25&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;
    &lt;span class=&#34;nv&#34;&gt;title&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;content&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;0&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;50&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;
    &lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;post_title&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;title&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;//&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;&amp;#34;&amp;#39;&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;
    &lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;post_content&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$content&lt;/span&gt;
  &lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;

  &lt;span class=&#34;nv&#34;&gt;locationfile&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;file&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;//.json.xz/_location.txt&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;

  &lt;span class=&#34;nv&#34;&gt;grepLocation&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$directoryWithInstagramPosts&lt;/span&gt;
  &lt;span class=&#34;nv&#34;&gt;grepLocation&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;+=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$instagramUser&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;/&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$locationfile&lt;/span&gt;

  &lt;span class=&#34;nv&#34;&gt;location&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;grep -s &lt;span class=&#34;s1&#34;&gt;&amp;#39;maps.google.com&amp;#39;&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$grepLocation&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[[&lt;/span&gt; ! -z &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$location&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;  &lt;span class=&#34;o&#34;&gt;]]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;then&lt;/span&gt;
  &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;found &lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$location&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;
    &lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;google_maps_link&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$location&lt;/span&gt; 
    &lt;span class=&#34;nv&#34;&gt;locationClean&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;location&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;&amp;amp;ll&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;
    &lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;latitude&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;cut -d&lt;span class=&#34;s1&#34;&gt;&amp;#39;=&amp;#39;&lt;/span&gt; -f &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$locationClean&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; cut -d&lt;span class=&#34;s1&#34;&gt;&amp;#39;\&amp;#39;&lt;/span&gt; -f &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; cut -d&lt;span class=&#34;s1&#34;&gt;&amp;#39;,&amp;#39;&lt;/span&gt; -f 1&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
    &lt;span class=&#34;nb&#34;&gt;export&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;longitude&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;$(&lt;/span&gt;cut -d&lt;span class=&#34;s1&#34;&gt;&amp;#39;=&amp;#39;&lt;/span&gt; -f &lt;span class=&#34;m&#34;&gt;2&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;&amp;lt;&amp;lt;&amp;lt;&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$locationClean&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; cut -d&lt;span class=&#34;s1&#34;&gt;&amp;#39;\&amp;#39;&lt;/span&gt; -f &lt;span class=&#34;m&#34;&gt;1&lt;/span&gt; &lt;span class=&#34;p&#34;&gt;|&lt;/span&gt; cut -d&lt;span class=&#34;s1&#34;&gt;&amp;#39;,&amp;#39;&lt;/span&gt; -f 2&lt;span class=&#34;k&#34;&gt;)&lt;/span&gt;
  &lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;

  &lt;span class=&#34;nv&#34;&gt;destination&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;=&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$blog&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;/content/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$instagramdir&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;/&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$date&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;-&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$time$post_slug&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;/&amp;#34;&lt;/span&gt;
  &lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[[&lt;/span&gt; ! -f &lt;span class=&#34;s2&#34;&gt;&amp;#34;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$destination&lt;/span&gt;&lt;span class=&#34;s2&#34;&gt;/index.md&amp;#34;&lt;/span&gt;  &lt;span class=&#34;o&#34;&gt;]]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;then&lt;/span&gt;
    hugo new &lt;span class=&#34;nv&#34;&gt;$instagramdir&lt;/span&gt;/&lt;span class=&#34;nv&#34;&gt;$date&lt;/span&gt;-&lt;span class=&#34;nv&#34;&gt;$time$post_slug&lt;/span&gt;/index.md
    cp &lt;span class=&#34;si&#34;&gt;${&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;1&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;:&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;r&lt;/span&gt;&lt;span class=&#34;si&#34;&gt;}&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;(&lt;/span&gt;*.jpg&lt;span class=&#34;p&#34;&gt;|&lt;/span&gt;*.mp4&lt;span class=&#34;o&#34;&gt;)&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$destination&lt;/span&gt;
  &lt;span class=&#34;k&#34;&gt;else&lt;/span&gt;
    &lt;span class=&#34;nb&#34;&gt;echo&lt;/span&gt; &lt;span class=&#34;s1&#34;&gt;&amp;#39;post exists: &amp;#39;&lt;/span&gt;&lt;span class=&#34;nv&#34;&gt;$post_title&lt;/span&gt;
  &lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;

&lt;span class=&#34;o&#34;&gt;}&lt;/span&gt;  &amp;gt;&lt;span class=&#34;p&#34;&gt;&amp;amp;&lt;/span&gt;&lt;span class=&#34;m&#34;&gt;2&lt;/span&gt;

&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[[&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;setup&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;]]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;then&lt;/span&gt;
  setup
&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;

&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[[&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;run-update&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;]]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;then&lt;/span&gt;
  run-update
&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;

&lt;span class=&#34;k&#34;&gt;if&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;[[&lt;/span&gt; &lt;span class=&#34;nv&#34;&gt;$1&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;=&lt;/span&gt; &lt;span class=&#34;s2&#34;&gt;&amp;#34;update-post&amp;#34;&lt;/span&gt; &lt;span class=&#34;o&#34;&gt;]]&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt; &lt;span class=&#34;k&#34;&gt;then&lt;/span&gt;
  update-post &lt;span class=&#34;nv&#34;&gt;$2&lt;/span&gt;
&lt;span class=&#34;k&#34;&gt;fi&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;


	

&lt;a style=&#34;background-color:black;color:white;text-decoration:none;padding:4px 6px;font-family:-apple-system, BlinkMacSystemFont, &amp;quot;San Francisco&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Ubuntu, Roboto, Noto, &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif;font-size:12px;font-weight:bold;line-height:1.2;display:inline-block;border-radius:3px&#34; href=&#34;https://www.pexels.com/@fotios-photos&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34; title=&#34;Photo by Lisa Fotios&#34;&gt;&lt;span style=&#34;display:inline-block;padding:2px 3px&#34;&gt;&lt;svg xmlns=&#34;http://www.w3.org/2000/svg&#34; style=&#34;height:12px;width:auto;position:relative;vertical-align:middle;top:-1px;fill:white&#34; viewBox=&#34;0 0 32 32&#34;&gt;&lt;title&gt;Unsplash Logo&lt;/title&gt;&lt;path d=&#34;M20.8 18.1c0 2.7-2.2 4.8-4.8 4.8s-4.8-2.1-4.8-4.8c0-2.7 2.2-4.8 4.8-4.8 2.7.1 4.8 2.2 4.8 4.8zm11.2-7.4v14.9c0 2.3-1.9 4.3-4.3 4.3h-23.4c-2.4 0-4.3-1.9-4.3-4.3v-15c0-2.3 1.9-4.3 4.3-4.3h3.7l.8-2.3c.4-1.1 1.7-2 2.9-2h8.6c1.2 0 2.5.9 2.9 2l.8 2.4h3.7c2.4 0 4.3 1.9 4.3 4.3zm-8.6 7.5c0-4.1-3.3-7.5-7.5-7.5-4.1 0-7.5 3.4-7.5 7.5s3.3 7.5 7.5 7.5c4.2-.1 7.5-3.4 7.5-7.5z&#34;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;span style=&#34;display:inline-block;padding:2px 3px&#34;&gt;Lisa Fotios&lt;/span&gt;&lt;/a&gt;
&lt;style type=&#34;text/css&#34;&gt;
  /* Background */ .chroma { background-color: #f0f0f0 }
  /* Error */ .chroma .err {  }
  /* LineTableTD */ .chroma .lntd { vertical-align: top; padding: 0; margin: 0; border: 0; }
  /* LineTable */ .chroma .lntable { border-spacing: 0; padding: 0; margin: 0; border: 0; width: auto; overflow: auto; display: block; }
  /* LineHighlight */ .chroma .hl { display: block; width: 100%;background-color: #ffffcc }
  /* LineNumbersTable */ .chroma .lnt { margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
  /* LineNumbers */ .chroma .ln { margin-right: 0.4em; padding: 0 0.4em 0 0.4em;color: #7f7f7f }
  /* Keyword */ .chroma .k { color: #007020; font-weight: bold }
  /* KeywordConstant */ .chroma .kc { color: #007020; font-weight: bold }
  /* KeywordDeclaration */ .chroma .kd { color: #007020; font-weight: bold }
  /* KeywordNamespace */ .chroma .kn { color: #007020; font-weight: bold }
  /* KeywordPseudo */ .chroma .kp { color: #007020 }
  /* KeywordReserved */ .chroma .kr { color: #007020; font-weight: bold }
  /* KeywordType */ .chroma .kt { color: #902000 }
  /* NameAttribute */ .chroma .na { color: #4070a0 }
  /* NameBuiltin */ .chroma .nb { color: #007020 }
  /* NameClass */ .chroma .nc { color: #0e84b5; font-weight: bold }
  /* NameConstant */ .chroma .no { color: #60add5 }
  /* NameDecorator */ .chroma .nd { color: #555555; font-weight: bold }
  /* NameEntity */ .chroma .ni { color: #d55537; font-weight: bold }
  /* NameException */ .chroma .ne { color: #007020 }
  /* NameFunction */ .chroma .nf { color: #06287e }
  /* NameLabel */ .chroma .nl { color: #002070; font-weight: bold }
  /* NameNamespace */ .chroma .nn { color: #0e84b5; font-weight: bold }
  /* NameTag */ .chroma .nt { color: #062873; font-weight: bold }
  /* NameVariable */ .chroma .nv { color: #bb60d5 }
  /* LiteralString */ .chroma .s { color: #4070a0 }
  /* LiteralStringAffix */ .chroma .sa { color: #4070a0 }
  /* LiteralStringBacktick */ .chroma .sb { color: #4070a0 }
  /* LiteralStringChar */ .chroma .sc { color: #4070a0 }
  /* LiteralStringDelimiter */ .chroma .dl { color: #4070a0 }
  /* LiteralStringDoc */ .chroma .sd { color: #4070a0; font-style: italic }
  /* LiteralStringDouble */ .chroma .s2 { color: #4070a0 }
  /* LiteralStringEscape */ .chroma .se { color: #4070a0; font-weight: bold }
  /* LiteralStringHeredoc */ .chroma .sh { color: #4070a0 }
  /* LiteralStringInterpol */ .chroma .si { color: #70a0d0; font-style: italic }
  /* LiteralStringOther */ .chroma .sx { color: #c65d09 }
  /* LiteralStringRegex */ .chroma .sr { color: #235388 }
  /* LiteralStringSingle */ .chroma .s1 { color: #4070a0 }
  /* LiteralStringSymbol */ .chroma .ss { color: #517918 }
  /* LiteralNumber */ .chroma .m { color: #40a070 }
  /* LiteralNumberBin */ .chroma .mb { color: #40a070 }
  /* LiteralNumberFloat */ .chroma .mf { color: #40a070 }
  /* LiteralNumberHex */ .chroma .mh { color: #40a070 }
  /* LiteralNumberInteger */ .chroma .mi { color: #40a070 }
  /* LiteralNumberIntegerLong */ .chroma .il { color: #40a070 }
  /* LiteralNumberOct */ .chroma .mo { color: #40a070 }
  /* Operator */ .chroma .o { color: #666666 }
  /* OperatorWord */ .chroma .ow { color: #007020; font-weight: bold }
  /* Comment */ .chroma .c { color: #60a0b0; font-style: italic }
  /* CommentHashbang */ .chroma .ch { color: #60a0b0; font-style: italic }
  /* CommentMultiline */ .chroma .cm { color: #60a0b0; font-style: italic }
  /* CommentSingle */ .chroma .c1 { color: #60a0b0; font-style: italic }
  /* CommentSpecial */ .chroma .cs { color: #60a0b0; background-color: #fff0f0 }
  /* CommentPreproc */ .chroma .cp { color: #007020 }
  /* CommentPreprocFile */ .chroma .cpf { color: #007020 }
  /* GenericDeleted */ .chroma .gd { color: #a00000 }
  /* GenericEmph */ .chroma .ge { font-style: italic }
  /* GenericError */ .chroma .gr { color: #ff0000 }
  /* GenericHeading */ .chroma .gh { color: #000080; font-weight: bold }
  /* GenericInserted */ .chroma .gi { color: #00a000 }
  /* GenericOutput */ .chroma .go { color: #888888 }
  /* GenericPrompt */ .chroma .gp { color: #c65d09; font-weight: bold }
  /* GenericStrong */ .chroma .gs { font-weight: bold }
  /* GenericSubheading */ .chroma .gu { color: #800080; font-weight: bold }
  /* GenericTraceback */ .chroma .gt { color: #0044dd }
  /* GenericUnderline */ .chroma .gl { text-decoration: underline }
  /* TextWhitespace */ .chroma .w { color: #bbbbbb }

&lt;/style&gt;

			</description>
		</item>
		
		<item>
			<title>Under the Hood</title>
			<link>https://brunoamaral.eu/post/under-the-hood/</link>
			<pubDate>Wed, 07 Feb 2018 10:44:23 +0000</pubDate>
			
			<guid>https://brunoamaral.eu/post/under-the-hood/</guid>
			<description>
				
				
				
				<![CDATA[<img src="https://brunoamaral.eu/post/under-the-hood/blake-connally-373084_hu3d03a01dcc18bc5be0e67db3d8d209a6_2683080_640x0_resize_q85_lanczos.jpg" width="640" height="427"/>]]>
				
				&lt;h2 id=&#34;what-is-a-static-site&#34;&gt;What is a static site&lt;/h2&gt;
&lt;p&gt;Most sites work like errand boys. You go to them, ask for something and they will get it for you. The obvious problem here is that it may take longer to find and deliver your request.&lt;/p&gt;
&lt;p&gt;The example is crude, but works. Most sites do have a database and each time you open a page, there is some behind the scenes work to gather and display what you have requested. It&amp;rsquo;s one of the reasons why some sites are slow. They may have a database that became too big, or too many visitors to be able to handle every request, some will have to wait.&lt;/p&gt;
&lt;p&gt;This site works more like a store. When you get there, whatever you need is already in stock for you to read.&lt;/p&gt;
&lt;p&gt;There is no database, every page here is like a PDF file: ready to deliver and open in any browser or device.&lt;/p&gt;
&lt;h3 id=&#34;speed-comes-at-a-cost&#34;&gt;Speed comes at a cost&lt;/h3&gt;
&lt;p&gt;Most static sites are very bare bones, with little or no search, comments, automation of social media posts, etc.&lt;/p&gt;
&lt;p&gt;The comments here are powered by an external website, &lt;a href=&#34;https://disqus.com/&#34;&gt;disqus.com&lt;/a&gt;, and the search function only works by using a service from &lt;a href=&#34;https://algolia.com/&#34;&gt;Algolia.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It also means I need to make sure every image is small enough to keep the pages light. (More on that soon.)&lt;/p&gt;
&lt;p&gt;The way I automate social media publishing is with &lt;a href=&#34;https://zapier.com&#34;&gt;Zapier&lt;/a&gt; and it&amp;rsquo;s integration with &lt;a href=&#34;https://buffer.com/&#34;&gt;Buffer.com&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id=&#34;flexibility-in-every-page&#34;&gt;Flexibility in every page&lt;/h3&gt;
&lt;p&gt;Dynamic sites that use information from a database don&amp;rsquo;t allow for much in terms of flexibility.&lt;/p&gt;
&lt;p&gt;For example, the story I called &lt;a href=&#34;https://brunoamaral.eu/story/crypto/&#34;&gt;CryptoNovel&lt;/a&gt; uses javascript to encrypt and decrypt each chapter and adding this feature didn&amp;rsquo;t impact the whole site like it would have if it need some logic behind it.&lt;/p&gt;
&lt;p&gt;It would go something like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;If the story is called Crypto, then add this piece of javascript code and this form logic so that the user can decrypt the text.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;a name=&#34;community&#34;&gt;
&lt;p&gt;It&amp;rsquo;s simple, but imagine asking this question once for each one of the 2000+ pages that make up this blog. At some point it would slow down the whole site.&lt;/p&gt;
&lt;h2 id=&#34;powered-by-a-community&#34;&gt;Powered by a Community&lt;/h2&gt;
&lt;p&gt;&lt;img src=&#34;gohugo.jpg&#34; alt=&#34;gohugo.jpg&#34;&gt;&lt;/p&gt;
&lt;p&gt;The first incarnation of the &amp;ldquo;Digital Insanity&amp;rdquo; blog used the &lt;a href=&#34;https://html5up.net/future-imperfect&#34;&gt;Future Imperfect theme&lt;/a&gt;, which I ported to use the &lt;a href=&#34;https://gohugo.io&#34;&gt;Hugo static site generator&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It received a great deal of improvements since then. I have added the concept of &lt;em&gt;Stories&lt;/em&gt;, made a good deal of SEO improvements, added structured data to the html, included my instagram feed and changed the way you see and use the search function.&lt;/p&gt;
&lt;p&gt;None of this would have been possible if Hugo was not open source and supported by an amazing community who helps developers solve problems in the forum.&lt;/p&gt;
&lt;p&gt;To everyone who participates there, please consider this my heartfelt way of thanking you for your time and dedication.&lt;/p&gt;
&lt;h2 id=&#34;tailored-content-and-smart-image-crop&#34;&gt;Tailored content and smart image crop&lt;/h2&gt;
&lt;p&gt;The flexibility of static files instead of a database is already good enough. I can go as far as have a fully different page if I like.&lt;/p&gt;
&lt;p&gt;Recently, Hugo got a new feature thanks to the work by &lt;a href=&#34;http://bep.is/&#34;&gt;Bjørn Erik Pedersen&lt;/a&gt;: smart image cropping. This feature uses another &lt;a href=&#34;https://github.com/muesli/smartcrop&#34;&gt;open source project by Christian Muehlhaeuser, smartcrop&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I was already running optimizations during the generation of the static sites, but without any way of making sure I was keeping the subject of the photo intact:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Optimize images

printf &amp;quot;\n${GREEN}### Build done, optimizing NEW images ###\n${NORMAL}&amp;quot;

if [ &amp;quot;$1&amp;quot; == &amp;quot;--all-images&amp;quot; ]
  then
      TAG=$(/usr/bin/git -C $DEFAULT_DIR rev-list --max-parents=0 HEAD)
  else
  # Find the images using the information in Git:
      TAG=$(/usr/bin/git -C $DEFAULT_DIR describe --tags --abbrev=0)
fi

# List the images to be optimized, using Git:
IMAGES=$(/usr/bin/git -C $DEFAULT_DIR diff --name-only $TAG | grep -E &#39;jpg|jpeg|JPG&#39;)

for i in $IMAGES; do
    NAME=$(basename $i)
  DIR=$(dirname $i)
  TARGET=&amp;quot;${i/content/$WEBSITE_DIR}&amp;quot;
  printf &amp;quot;processing: $DIR | $TARGET&amp;quot;
  /usr/bin/jpegoptim --all-progressive -p -o $TARGET
  cd &amp;quot;$(dirname $TARGET)&amp;quot; &amp;amp;&amp;amp; /usr/bin/convert $TARGET -verbose -resize 500x500 -set filename:original &#39;%t&#39; %[filename:original]_500.jpg ;

   /usr/bin/jpegtran -outfile $TARGET.out -copy none -optimize -perfect $TARGET &amp;amp;&amp;amp; mv $TARGET.out $TARGET &amp;amp;&amp;amp; chmod 644 $TARGET
done
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;security-and-simplicity&#34;&gt;Security and Simplicity&lt;/h2&gt;
&lt;p&gt;Since every file is already present in the server, there is no processing and less chances of the server being hacked.&lt;/p&gt;
&lt;p&gt;Another thing is it makes me question: &amp;ldquo;Do I really need this feature?&amp;rdquo; Most of the times no, I do not need a fancy contact form or flashy pop up with information to subscribe.&lt;/p&gt;
&lt;h2 id=&#34;contact-form&#34;&gt;Contact Form&lt;/h2&gt;
&lt;p&gt;The contact form page is powered by a service called &lt;a href=&#34;https://formspree.io/&#34;&gt;FormSpree&lt;/a&gt;. It&amp;rsquo;s first tier is free and will deliver any input to the email address specified.&lt;/p&gt;
&lt;p&gt;Again, less configuration and a better experience for the user.&lt;/p&gt;
&lt;h2 id=&#34;tinyletter&#34;&gt;TinyLetter&lt;/h2&gt;
&lt;p&gt;I wanted a no-thrills way of sending a newsletter and this was perfect. It allows for simple formatting of titles, lists and links.&lt;/p&gt;
&lt;p&gt;To save time, I have Zapier keeping watch over the blog and preparing the content for me. All that is left for me to do is tweak the formatting and press send. What&amp;rsquo;s best? I can place the subscribe form anywhere.&lt;/p&gt;
&lt;form style=&#34;&#34; action=&#34;https://tinyletter.com/brunoamaral&#34; method=&#34;post&#34; target=&#34;popupwindow&#34; onsubmit=&#34;window.open(&#39;https://tinyletter.com/brunoamaral&#39;, &#39;popupwindow&#39;, &#39;scrollbars=yes,width=800,height=600&#39;);return true&#34;&gt;
&lt;label for=&#34;tlemail&#34;&gt;Email&lt;/label&gt;
&lt;input type=&#34;text&#34; style=&#34;width:20em; margin-right:20px; float: left;&#34; name=&#34;email&#34; id=&#34;tlemail&#34;&gt;
&lt;input type=&#34;hidden&#34; value=&#34;1&#34; name=&#34;embed&#34;&gt;
&lt;input type=&#34;submit&#34; value=&#34;Subscribe&#34;&gt;
&lt;p&gt;&lt;a href=&#34;https://tinyletter.com&#34; target=&#34;_blank&#34;&gt;powered by TinyLetter&lt;/a&gt;&lt;/p&gt;
&lt;/form&gt;
&lt;h1 id=&#34;why-keep-a-blog-or-a-site&#34;&gt;Why keep a blog or a Site?&lt;/h1&gt;
&lt;p&gt;I still believe in good long form content. Specially if you mix it up between images, videos, gifs and whatever else is relevant. Lately I have even been thinking about migrating old content onto new sections of this site.&lt;/p&gt;
&lt;p&gt;Here, anything can be posted. I did tiny experiments with video, little clips with less than a minute that YouTube insisted to take down because I didn&amp;rsquo;t own the rights for the music I used.&lt;/p&gt;
&lt;p&gt;This site can also be made more personal to the point of sending a page to a single person or group. In fact, it&amp;rsquo;s riddled with hidden sections, draft projects, personal notes, and self reminders.&lt;/p&gt;
&lt;p&gt;This would be harder to do with a Dynamic Site since the complexity behind the scenes is always too much for me to grasp and be 100% sure it&amp;rsquo;s working.&lt;/p&gt;
&lt;h2 id=&#34;its-about-the-story-its-about-being-different&#34;&gt;It&amp;rsquo;s about the story, it&amp;rsquo;s about being different&lt;/h2&gt;
&lt;p&gt;Sharing things with friends and family on Facebook and instagram can be cool, but it&amp;rsquo;s ephemeral. Facebook and Instagram&amp;rsquo;s Algorithms only give you a certain measure of exposure and once that&amp;rsquo;s gone, it&amp;rsquo;s forever.&lt;/p&gt;
&lt;p&gt;Here, I hope to drive people to stumble upon more posts and stories to read. The &lt;a href=&#34;https://brunoamaral.eu/story/photo-storytelling/&#34;&gt;Photo Story Telling Challenge&lt;/a&gt; is one of those things.&lt;/p&gt;
&lt;p&gt;And does Facebook represent the whole range of interests you have? Here I can post my notes of &lt;a href=&#34;https://brunoamaral.eu/tags/uxlx/&#34;&gt;UXLx&lt;/a&gt; and keep it in context. I can go as far as translate one of my favourite poems and display it in both languages I speak: &lt;a href=&#34;https://brunoamaral.eu/post/poema-em-linha-reta/&#34;&gt;English&lt;/a&gt; and &lt;a href=&#34;https://brunoamaral.eu/pt/post/poema-em-linha-reta/&#34;&gt;Portuguese&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;We need better ways to share what is important to us, and to have as much control as possible over the content we produce. And also, to mix and match the things we find along the way into a (half) coherent exposé of why we take the time to develop and write a blog.&lt;/p&gt;
&lt;p&gt;A blog or a website is not the medium by excellence, sure I don&amp;rsquo;t think anything really is. What I do think is that so far this is the best solution to talk about the different thinks that interest me. It&amp;rsquo;s also future proof, since this site does not need to host a database or support a programming language like PHP. It will certainly be available to be read in 10 years time. I also get the luxury of a nice daily backup on my computer and on GitHub.&lt;/p&gt;
&lt;p&gt;It comes with the added bonus of freedom. I don&amp;rsquo;t have to annoy you with ads, I don&amp;rsquo;t have to post everyday or worry about &lt;em&gt;likes&lt;/em&gt;. I can relax and just make this virtual place into whatever I like, while at same time can write this article sitting in the sofa, on my computer or phone.&lt;/p&gt;
&lt;p&gt;Isn&amp;rsquo;t this what technology should do? Take away restrains and give us freedom to connect with others in different and creative ways.&lt;/p&gt;
&lt;p&gt;&lt;a style=&#34;background-color:black;color:white;text-decoration:none;padding:4px 6px;font-family:-apple-system, BlinkMacSystemFont, &amp;quot;San Francisco&amp;quot;, &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Ubuntu, Roboto, Noto, &amp;quot;Segoe UI&amp;quot;, Arial, sans-serif;font-size:12px;font-weight:bold;line-height:1.2;display:inline-block;border-radius:3px;&#34; href=&#34;https://unsplash.com/@blakeconnally?utm_medium=referral&amp;amp;utm_campaign=photographer-credit&amp;amp;utm_content=creditBadge&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34; title=&#34;Download free do whatever you want high-resolution photos from Blake Connally&#34;&gt;&lt;span style=&#34;display:inline-block;padding:2px 3px;&#34;&gt;&lt;svg xmlns=&#34;http://www.w3.org/2000/svg&#34; style=&#34;height:12px;width:auto;position:relative;vertical-align:middle;top:-1px;fill:white;&#34; viewBox=&#34;0 0 32 32&#34;&gt;&lt;title&gt;unsplash-logo&lt;/title&gt;&lt;path d=&#34;M20.8 18.1c0 2.7-2.2 4.8-4.8 4.8s-4.8-2.1-4.8-4.8c0-2.7 2.2-4.8 4.8-4.8 2.7.1 4.8 2.2 4.8 4.8zm11.2-7.4v14.9c0 2.3-1.9 4.3-4.3 4.3h-23.4c-2.4 0-4.3-1.9-4.3-4.3v-15c0-2.3 1.9-4.3 4.3-4.3h3.7l.8-2.3c.4-1.1 1.7-2 2.9-2h8.6c1.2 0 2.5.9 2.9 2l.8 2.4h3.7c2.4 0 4.3 1.9 4.3 4.3zm-8.6 7.5c0-4.1-3.3-7.5-7.5-7.5-4.1 0-7.5 3.4-7.5 7.5s3.3 7.5 7.5 7.5c4.2-.1 7.5-3.4 7.5-7.5z&#34;&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/span&gt;&lt;span style=&#34;display:inline-block;padding:2px 3px;&#34;&gt;Blake Connally&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;

			</description>
		</item>
		
		<item>
			<title>#cid20 #geek</title>
			<link>https://brunoamaral.eu/instagram/2014-09-27-07-52-35-cid20-geek/</link>
			<pubDate>Sat, 27 Sep 2014 07:52:35 +0000</pubDate>
			
			<guid>https://brunoamaral.eu/instagram/2014-09-27-07-52-35-cid20-geek/</guid>
			<description>
				
				
				
				<![CDATA[<img src="https://brunoamaral.eu/instagram/2014-09-27-07-52-35-cid20-geek/2014-09-27_07-52-35_UTC_hu33dc7e64a7ce778e93c8fed4eb8d653b_114335_640x0_resize_q85_lanczos.jpg" width="640" height="640"/>]]>
				
				&lt;p&gt;&amp;ldquo;#cid20 #geek&amp;rdquo;&lt;/p&gt;

			</description>
		</item>
		
		<item>
			<title>X-Ray of a broken political system</title>
			<link>https://brunoamaral.eu/post/x-ray-of-a-broken-political-system/</link>
			<pubDate>Sun, 29 Dec 2013 22:55:19 +0000</pubDate>
			
			<guid>https://brunoamaral.eu/post/x-ray-of-a-broken-political-system/</guid>
			<description>
				
				
				&lt;p&gt;The picture in this post is an infographic built by &lt;a href=&#34;https://pmcruz.com/about&#34;&gt;Pedro Cruz&lt;/a&gt;. The circles represent portuguese companies. The bigger the circle, the more politicians where involved in managing it. You can find it here: &lt;a href=&#34;https://pmcruz.com/eco/&#34;&gt;https://pmcruz.com/eco/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;He called it “&lt;a href=&#34;https://pmcruz.com/eco/&#34;&gt;An ecosystem of Corporate Politicians&lt;/a&gt;“, I call it an X-Ray of a broken political system.&lt;/p&gt;
&lt;p&gt;The dataset includes data from 1975 to 2013. Which shows that this is not just a problem to be fixed, it’s a whole tradition of mixed interests and loyalties. I, for one, have long ago lost all faith in the political parties available. Whenever there is an election, I get myself out of the house to stand in line, show my ID card and push a blank vote down the ballot box. It’s my way of saying that I care, but that none of the options available make any sense to me.&lt;/p&gt;
&lt;p&gt;Now, seeing the way major companies are organised around the political system, I can’t help but feel a bit more of dismay and, this is new, a lot more anger towards the political class.&lt;/p&gt;
&lt;h3 id=&#34;three-players-and-no-communication&#34;&gt;Three players and no communication&lt;/h3&gt;
&lt;p&gt;Just keep this in mind, our PM is a social-democrat faced with a country taking financial hits from all sides, he is therefore forced to resolve all these issues of alliances between companies and opposing parties to get anything done. While he does that, we get news from him saying that things are looking up with no clear signal that they in fact are. Taxes are still high, starting a profitable company sounds like pulling off a miracle and some families are at the brink of poverty.&lt;/p&gt;
&lt;p&gt;On the other side of things, the Socialist Party is a joke. Their communication strategy is to wait for any action by the social democrats and to counter it with an ideological speech. There is no clear plan, no actionable ideas, just shouts and soundbites against the prime minister.&lt;/p&gt;
&lt;p&gt;The communist parties do pretty much the same, trying to rally up the middle and lower class towards demands of better quality of life and most of the time undermining any scarce effort for a joining of hands towards a solution.&lt;/p&gt;
&lt;p&gt;As for the President, well, there is nothing I can say about him because I haven’t seen any action on his part. Ever. So he’s the non-playing character of this system.&lt;/p&gt;
&lt;p&gt;In this scenario I don’t trust any of the remaining members of our government to be virtuous and make the right decision if they have to choose between the people or their own companies (and well-being).&lt;/p&gt;
&lt;h3 id=&#34;hacking-it-to-fix-it&#34;&gt;Hacking it to fix it&lt;/h3&gt;
&lt;p&gt;Have you ever worked with an old computer? Or even an old software at your job that everybody hates and that stopped being efficient a million years ago?&lt;/p&gt;
&lt;p&gt;I am going to take a leap here and say that if you answered any of those questions affirmatively that computer or software was soon replaced with a newer model. Sadly we can’t just throw our politicians out of a window like we did in the past. Also, I don’t expect to see this government passing laws that enforce political independence from private companies.&lt;/p&gt;
&lt;p&gt;The solution I see is to raise the bar on political scrutiny. In a balanced social system, this scrutiny would come from journalist and media companies. In this status quo journalists have little resources and whether they want to or not, their publications are in some way tied to some of the major portuguese companies.&lt;/p&gt;
&lt;p&gt;In Portugal, Political Scrutiny, good or bad, needs to come from hackers and geeks. People eager to learn and eager to build things that help others. &lt;a href=&#34;https://cidadania20.com/&#34;&gt;And there are already some good examples out there about what can be done&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;One of them is &lt;a href=&#34;https://www.promessaspoliticas.com/&#34;&gt;a site where people can view what political promises were made by their mayor&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To help fix this system, we could take that idea one step further and list relevant political actions and laws passed, with names of those involved and the private companies they work with. The goal would be to bring just a bit more transparency to politics. Of course it wouldn’t work forever, but it would at least serve as a deterrent.&lt;/p&gt;
&lt;h3 id=&#34;what8217s-the-use-&#34;&gt;What’s the use ?&lt;/h3&gt;
&lt;p&gt;Probably nothing. This idea will by no means result in a complete fix for the broken system. The only good fix would be a full reboot but we simply can’t afford it. We have however entered a time when we must take matters into our own hands.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Patch it wherever possible,&lt;/li&gt;
&lt;li&gt;Build new tools to empower citizens,&lt;/li&gt;
&lt;li&gt;Make it more transparent,&lt;/li&gt;
&lt;li&gt;Throw away ideology in favour of practical and effective projects.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We have sat on our hands and the political class had their opportunity to show results. It’s about time we take action.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;

			</description>
		</item>
		
		<item>
			<title>A New Perspective</title>
			<link>https://brunoamaral.eu/post/a-new-perspective/</link>
			<pubDate>Mon, 23 Sep 2013 12:20:22 +0000</pubDate>
			
			<guid>https://brunoamaral.eu/post/a-new-perspective/</guid>
			<description>
				
				
				
				<![CDATA[<img src="https://brunoamaral.eu/post/a-new-perspective/2013-04-22-12.08.52-700x525_hu4078cb09fa20a21eaac92adb52430087_64653_640x0_resize_q85_lanczos.jpg" width="640" height="480"/>]]>
				
				&lt;p&gt; &lt;/p&gt;
&lt;p&gt;This blog was a bit stuck in the dark ages of blogging and was in need of a redesign, in all definitions of the word: a new look and a new reading experience, as well as a revised editorial line.&lt;/p&gt;
&lt;p&gt;Fortunately I know some amazing people, one of them being &lt;a href=&#34;https://www.definegravity.co/&#34;&gt;Diana Costa&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;With her help, there is now a new logo and a new design. It is more focused on the content and the reading experience and adapts gently to any screen size.&lt;/p&gt;
&lt;p&gt;I liked her solution so much that instead of applying it to an existing wordpress template I went the extra mile and coded it all from scratch. It is using the latest &lt;a href=&#34;https://getbootstrap.com/&#34;&gt;Twitter Bootstrap Framework&lt;/a&gt; with a 16 column grid instead of the usual 12 columns. This saved several days of coding to get the first prototype.&lt;/p&gt;
&lt;p&gt;And because the search function is paramount on any website, it is there at the header for when you need it taking up the whole screen so you can focus and find what you are looking. For an added bonus, check out what happens when you search and don’t get results.&lt;/p&gt;
&lt;p&gt;But there is more.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p style=&#34;text-align: center;&#34;&gt;
  &lt;img class=&#34;size-full wp-image-1537 aligncenter&#34; alt=&#34;Screen Shot 2013-09-08 at 19.18.16&#34; src=Screen-Shot-2013-09-08-at-19.18.16-.png&#34; width=&#34;301&#34; height=&#34;200&#34; srcset=Screen-Shot-2013-09-08-at-19.18.16--300x199.png 300w,Screen-Shot-2013-09-08-at-19.18.16-.png 301w&#34; sizes=&#34;(max-width: 301px) 100vw, 301px&#34; /&gt;
&lt;/p&gt;
&lt;p&gt;To make the blog a more compelling experience I reviewed the whole editorial line I was following. So now you have the following categories, or perspectives:&lt;/p&gt;
&lt;h3 id=&#34;span-stylecolor-219ce9communicationspan-communication-and-span-stylecolor-fbc800webspan&#34;&gt;&lt;span style=&#34;color: #219ce9;&#34;&gt;Communication&lt;/span&gt;; Communication and &lt;span style=&#34;color: #fbc800;&#34;&gt;Web&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;Not all communication is about the web, but the web is always about communication. If you want to check out the ideas and opinion, papers and articles on Communication and Relationship Management, then you need can follow the communication part which will include the web perspective as a sub-category.&lt;/p&gt;
&lt;p&gt;Buf If all you care about is what’s new online and how it can help you communicate or how it changes the way we relate with each other, then you should read the Web perspective in its own single category.&lt;/p&gt;
&lt;p&gt;This is a split-hair. I was inclined to just keep the Web category and drop it in favor of Communication or vice versa. But the web has always been social, always been about communicating and collaborating with people across the globe. Therefore they need to be present and intertwined.&lt;/p&gt;
&lt;h3 id=&#34;span-stylefont-size-117em-color-45aa05businessspan&#34;&gt;&lt;span style=&#34;font-size: 1.17em; color: #45aa05;&#34;&gt;Business&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;With so many things that change online and offline, what does that mean for business? This is where I want to share what perils and what opportunities show up whenever a major player like facebook, twitter, or google makes changes or when we as users switch from one platform to the other. This is also where I am going to expand on the idea of strategy and around the need for a concept of communication strategy, either digital or analog.&lt;/p&gt;
&lt;h3 id=&#34;span-stylecolor-dd1100geekspan&#34;&gt;&lt;span style=&#34;color: #dd1100;&#34;&gt;Geek&lt;/span&gt;&lt;/h3&gt;
&lt;p&gt;I don’t hide that I am a Geek and in fact I  am quite proud of that. So it was only fitting that for a personal perspective I would embrace this trait. This is where I will share what is happening with me, the bits and pieces of code I come up with, the pet projects and aspirations. This is the window where you will have a chance to peak into my world of madness and coffee.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;

			</description>
		</item>
		
		<item>
			<title>Exporting Things.app tasks to Todo.txt format</title>
			<link>https://brunoamaral.eu/post/exporting-things-app-tasks-to-todo-txt-format/</link>
			<pubDate>Wed, 03 Jul 2013 10:15:32 +0000</pubDate>
			
			<guid>https://brunoamaral.eu/post/exporting-things-app-tasks-to-todo-txt-format/</guid>
			<description>
				
				
				
				<![CDATA[<img src="https://brunoamaral.eu/post/exporting-things-app-tasks-to-todo-txt-format/9178807564_3cbaeb444d_c_hu965bfb7ac408d04bc1d2d4e9435b3f3c_227802_640x0_resize_q85_lanczos.jpg" width="640" height="480"/>]]>
				
				&lt;p&gt;Warning, there is some serious geek talk coming up.&lt;/p&gt;
&lt;p&gt;Long story short I have been using &lt;a href=&#34;https://culturedcode.com/&#34;&gt;Things&lt;/a&gt; as my task management for a long time. What is bad about these tools is that they rarely allow you to export or save your tasks into a universal format that can be read by any app.&lt;/p&gt;
&lt;p&gt;Fortunately, Gina Trapani came up with &lt;a href=&#34;https://todotxt.com/&#34;&gt;Todo.txt&lt;/a&gt; calling it a &lt;strong&gt;Future-proof task tracking in a file you control&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Since it works with a simple text file you can use it together with &lt;a href=&#34;https://db.tt/HZob1t8&#34;&gt;Dropbox&lt;/a&gt; and sync it across devices.&lt;/p&gt;
&lt;p&gt;I think you can see where I am getting at…&lt;/p&gt;
&lt;p&gt;If &lt;a href=&#34;https://github.com/ginatrapani/todo.txt-cli/wiki/The-Todo.txt-Format&#34;&gt;Todo.txt is so simple and useful it makes perfect sense to use it as the universal format to save/export/import tasks&lt;/a&gt;. To make this perfect, there are a few task management tools that support the todo.txt syntax.&lt;/p&gt;
&lt;p&gt;So I dove into the Things.app applescript documentation and after a while came up with a little script that you can use to export your tasks and break free so you can try out other task management solutions or even come up with your own.&lt;/p&gt;
&lt;p&gt;Everything is &lt;a href=&#34;https://github.com/brunoamaral/export-things-todotxt&#34;&gt;available for free in my github account&lt;/a&gt;, I hope you find it useful.&lt;/p&gt;

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