The plan was simple: Go to Facebook, use their “download my data” feature and then convert it from JSON to markdown so I can import it into my Quickies section, to host the content primarily on my site.

However, from planning to actually finishing the thing, I encountered some issues. The first one that I noticed is that I have to sift through about 9000 items posted on facebook in the last 17 years or so, and it would be pretty time consuming, and I don’t have the energy or will to do this.

The second issue is that with all the photos and videos I’d add to the site, the storage necessity of the website would increase by about 21GB, more than doubling its size.

The third and the most important issue is that facebook somehow bundles folders with photos from posts, messages, comments and other information and the risk of exposing very sensitive private data (like friend’s full names, locations, GPS coordinates, etc) is very high, so I just decided it’s not worth it. The file your_uncategorized_photos.json is especially concerning, because it contains images that I’ve sent in private messages. Looking at the file structure, even the filenames themselves contain my facebook user ID, which can be used very easy to doxx myself, not that I’m a well hidden person, but in principle.

After a quick thought, considering carefully the upsides and downsides of the entire thing, even if this is my content, I chose not to add it to my site, to consider it obsolete content and drop it completely. I will probably keep an archive in my personal home storage, in case I ever need to find stuff in there.

Because I did a bit of coding there, I’ll leave the crude PHP code below. It’s not very functional and it’s not optimized at all, but it’s a good start.

Crude PHP code
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<meta charset="UTF-8" />
<?php 

if(true) {
	// PROCESSING POSTS, CHECKINS, PHOTOS AND VIDEOS -- this basically make your profile's wall, stuff posted by you
	$json = file_get_contents('./your_facebook_activity/posts/your_posts__check_ins__photos_and_videos_1.json'); 
	$json_data = json_decode($json, true); 
		
	foreach($json_data as $item) {
		echo "<code>";
		echo $item['timestamp'].".md";
		echo "</code>";
		echo "<pre>";
		
		if($item['data'][0]['post'] != '') {
			$title = utf8_decode($item['data'][0]['post']);
		} elseif($item['title'] != '') {
			$title = utf8_decode($item['title']);
		} else {
			$title = $item['timestamp'];
		}
		$images = array();
		foreach($item['attachments'][0]['data'] as $att) {
			$images[] = '"'.$att['media']['uri'].'"';
		}
		
		echo count($images);
		
		if(count($images) == 1) { $tags = 'photo'; } else { $tags = 'post'; }
		?>
---
title: "<?php echo $title; ?>"
date: <?php echo date('c', $item['timestamp']); ?> 
draft: false
section: 'post'
hidetitle: true
tags: [
	"<?php echo $tags ?>",
]
<?php if(count($images) < 1) { } elseif(count($images) == 1) { echo "cover: ".$images[0]; } else { echo "images: [\n\t".implode(",\n\t", $images)."\n]"; } ?> 
---

<?php print_r($images); ?>	
	
	<?php 
		echo "</pre>";
	}
}		

/*  ******************************************************  */



if(false) {
	// PROCESSING UNCATEGORIZED PHOTOS -- this are mostly photos sent as messages, photo comments, photos posted on some other's profiles and facebook stories
	$json = file_get_contents('./your_facebook_activity/posts/your_uncategorized_photos.json'); 
	$json_data = json_decode($json, true); 
	
	foreach($json_data['other_photos_v2'] as $item) {
		print_r($item);
		echo "<code>";
		echo $item['creation_timestamp'].".md";
		echo "</code>";
		echo "<pre>";
		
		if($item['title'] != '') {
			$title = $item['title'];
		} else {
			$title = $item['creation_timestamp'];
		}
		?>
	
---
title: "<?php echo $title; ?>"
date: <?php echo date('c', $item['creation_timestamp']); ?> 
draft: false
section: 'photos'
hidetitle: true
tags: [
	"photo",
]
---

{{ < image source="<?php echo $item['uri']; ?>" href="<?php echo $item['uri']; ?>" > }}

<img src="<?php echo $item['uri']; ?>">

<?php echo utf8_decode($item['description']); ?>

	<?php 
		echo "</pre>";
	}
}		



/*  ******************************************************  */



if(false) {
	// PROCESSING VIDEOS
	$json = file_get_contents('./your_facebook_activity/posts/your_videos.json'); 
	$json_data = json_decode($json, true); 
	
	foreach($json_data['videos_v2'] as $item) {
		echo "<code>";
		echo $item['creation_timestamp'].".md";
		echo "</code>";
		echo "<pre>";
		
		if($item['title'] != '') {
			$title = $item['title'];
		} else {
			$title = $item['creation_timestamp'];
		}
		?>
---
title: "<?php echo $title; ?>"
date: <?php echo date('c', $item['creation_timestamp']); ?> 
draft: false
section: 'video'
hidetitle: true
tags: [
	"video",
]
---

{{ < video source="<?php echo $item['uri']; ?>" poster="<?php echo $item['uri']; ?>.jpg" > }}

<?php echo utf8_decode($item['description']); ?>
	<?php 
		echo "</pre>";
	}
}		
	
?>