Archiving Catherine's Instagram

Peter Rukavina

I’ve been working on a way of keeping the photos and videos in Catherine’s Instagram online without Instagram, and finally came up with a solution today, which you can browse to your heart’s content at:

http://eramosa.net/instagram

Catherine posted to Instagram for four years, from December of 2015 to December of 2019. She started and ended in the Christmas season, and so both her first video and her last video were of the Christmas village that gets set up in our dining room every year.

To generate this static HTML version, I started with a data dump requested from Instagram, and wrote a short PHP script to process the media.json file found therein, which contains an index of every photo, video and story in the archive.

The script first loads in the JSON file and converts it to a PHP object:

$media_file = file_get_contents("media.json");
$media = json_decode($media_file);

Then it generates a thumbnail image, using ImageMagick, for every image, and writes the HTML needed to render that image, and link to the original:

fwrite($fp, "<h2>Photos</h2>\n");
foreach($media->photos as $key => $photo) {
	$html = "<a href='" . $photo->path . "'><img src='thumbnails/" . $photo->path . "' width='200' height='200' alt='" . htmlentities($photo->caption, ENT_QUOTES) . "' title='" . htmlentities($photo->caption, ENT_QUOTES) . "'></a> ";
	fwrite($fp, $html . "\n");
	$parts = explode("/", $photo->path);
	$subdir = $parts[1];
	if (!file_exists("thumbnails/photos/$subdir")) {
		system("mkdir thumbnails/photos/$subdir");
	}
	if (!file_exists("thumbnails/" . $photo->path)) {
		system("convert " . $photo->path . " -resize 200x200 thumbnails/" . $photo->path);
	}
}

It goes through the same process for the videos and stories, the result being one big index.html that shows everything. A sort of anti-Instagram, UX-wise.

I uploaded this file, along with the generated thumbnails and the photos, videos and stories directories, to an Amazon S3 bucket, wired up Catherine’s eramosa.net domain name to the bucket and, presto, static website.

Screen shot of Catherine's static Instagram archive.

Comments

Submitted by Cindy Hanson on

Permalink

What a lovely collection! I’m relatively new to instagram and had not seen most of these pictures. It’s such a great archive of her material artwork and love of travel. Thanks for doing this

Add new comment

Plain text

  • Allowed HTML tags: <b> <i> <em> <strong> <blockquote> <code> <ul> <ol> <li>
  • Lines and paragraphs break automatically.

About This Blog

Photo of Peter RukavinaI am . I am a writer, letterpress printer, and a curious person.

To learn more about me, read my /nowlook at my bio, listen to audio I’ve posted, read presentations and speeches I’ve written, or get in touch (peter@rukavina.net is the quickest way). 

You can subscribe to an RSS feed of posts, an RSS feed of comments, or a podcast RSS feed that just contains audio posts. You can also receive a daily digests of posts by email.

Search