<commit_before><?php

	header('Content-type: application/json');

	$data = json_decode(file_get_contents('http://axelchang.com/koken/api.php?/albums/slug:portfolio/content'));
	$dataAbout = json_decode( file_get_contents('http://axelchang.com/koken/api.php?/text') );
	$dataNews = json_decode(file_get_contents('http://axelchang.com/koken/api.php?/albums/slug:news/content'));

	// Start JSON
	echo '{';

	$max = count($data->albums);
	$i = 0;

	echo '"portfolio" : [';
	foreach ( $data->albums as $album ) {

		echo '{';
			echo '"id" : "' . $album->id . '",';
			echo '"title" : "' . $album->title . '",';
			echo '"slug" : "' . $album->slug . '",';
			echo '"cover" : "' . $album->covers[0]->presets->medium->url . '",';
			echo '"width" : "' . $album->covers[0]->presets->medium->width . '",';
			echo '"height" : "' . $album->covers[0]->presets->medium->height . '",';
			echo '"images" : [';

				$jsonAlbum = json_decode(file_get_contents('http://axelchang.com/koken/api.php?/albums/'.$album->id.'/content')); 
				$maxContent = count($jsonAlbum->content);
				$j = 0;
				foreach ( $jsonAlbum->content as $content ) {
					echo '{';
						echo '"img" : "' . $content->presets->huge->url . '",';
						echo '"credits" : "' . clean($content->caption) . '"';
					echo '}';

					if ( $j < $maxContent - 1 ) echo ',';
					$j++;
				}

			echo ']';
		echo '}';

		if ( $i < $max - 1 ) echo ',';
		$i++;
	}
	echo '],';

	echo '"news" : [';

		$maxArticle = count($dataNews->content);
		$k = 0;
		
		foreach ( $dataNews->content as $article ) {

			echo '{';
				echo '"id" : "' . $article->id . '",';
				echo '"slug" : "' . $article->slug . '",';
				echo '"text" : "' . $article->caption . '",';
				echo '"img" : "' . $article->presets->huge->url . '"';
			echo '}';

			if ( $k < $maxArticle - 1 ) echo ',';
			$k++;

		}

		foreach ( $dataAbout->text as $text ) {
			if ( $text->slug == "about-french" ) {
				$dataAboutFR = $text->content;
			}
			if ( $text->slug == "about-english" ) {
				$dataAboutEN = $text->content;
			}
			if ( $text->slug == "about-german" ) {
				$dataAboutDE = $text->content;
			}
		}


	echo '],

		"about" : {
			"image" : "img/axel-chang.jpg",
			"imagetablet" : "img/axel-chang-tablet.jpg",
			"fr" : "' . addslashes(encodeAccent(trim($dataAboutFR))) . '",
			"en" : "' . addslashes(encodeAccent(trim($dataAboutEN))) . '",
			"de" : "' . addslashes(encodeAccent(trim($dataAboutDE))) . '"
		},

		"contact" : {
			"email" : {
				"link" : "mailto:<EMAIL>",
				"label" : "<EMAIL>"
			},
			"phone" : {<commit_msg>up data<commit_after><?php

	header('Content-type: application/json');

	$data = json_decode(file_get_contents('http://axelchang.com/koken/api.php?/albums/slug:portfolio/content'));
	$dataAbout = json_decode( file_get_contents('http://axelchang.com/koken/api.php?/text') );
	$dataNews = json_decode(file_get_contents('http://axelchang.com/koken/api.php?/albums/slug:news/content'));

	foreach ( $dataAbout->text as $text ) {	
		if ( $text->slug == "about-french" ) {
			$dataAboutFR = $text->content;
		}
		if ( $text->slug == "about-english" ) {
			$dataAboutEN = $text->content;
		}
		if ( $text->slug == "about-german" ) {
			$dataAboutDE = $text->content;
		}
	}

	// Start JSON
	echo '{';

	$max = count($data->albums);
	$i = 0;

	echo '"portfolio" : [';
	foreach ( $data->albums as $album ) {

		echo '{';
			echo '"id" : "' . $album->id . '",';
			echo '"title" : "' . $album->title . '",';
			echo '"slug" : "' . $album->slug . '",';
			echo '"cover" : "' . $album->covers[0]->presets->medium->url . '",';
			echo '"width" : "' . $album->covers[0]->presets->medium->width . '",';
			echo '"height" : "' . $album->covers[0]->presets->medium->height . '",';
			echo '"images" : [';

				$jsonAlbum = json_decode(file_get_contents('http://axelchang.com/koken/api.php?/albums/'.$album->id.'/content')); 
				$maxContent = count($jsonAlbum->content);
				$j = 0;
				foreach ( $jsonAlbum->content as $content ) {
					echo '{';
						echo '"img" : "' . $content->presets->huge->url . '",';
						echo '"credits" : "' . clean($content->caption) . '"';
					echo '}';

					if ( $j < $maxContent - 1 ) echo ',';
					$j++;
				}

			echo ']';
		echo '}';

		if ( $i < $max - 1 ) echo ',';
		$i++;
	}
	echo '],';

	echo '"news" : [';

		$maxArticle = count($dataNews->content);
		$k = 0;
		
		foreach ( $dataNews->content as $article ) {

			echo '{';
				echo '"id" : "' . $article->id . '",';
				echo '"slug" : "' . $article->slug . '",';
				echo '"text" : "' . $article->caption . '",';
				echo '"img" : "' . $article->presets->huge->url . '"';
			echo '}';

			if ( $k < $maxArticle - 1 ) echo ',';
			$k++;

		}


	echo '],

		"about" : {
			"image" : "img/axel-chang.jpg",
			"imagetablet" : "img/axel-chang-tablet.jpg",
			"fr" : "' . addslashes(encodeAccent(trim($dataAboutFR))) . '",
			"en" : "' . addslashes(encodeAccent(trim($dataAboutEN))) . '",
			"de" : "' . addslashes(encodeAccent(trim($dataAboutDE))) . '"
		},

		"contact" : {
			"email" : {
				"link" : "mailto:<EMAIL>",
				"label" : "<EMAIL>"
			},
			"phone" : {
{'fraction_non_alphanumeric': 0.2563800549666274, 'fraction_numerical': 0.0035335689045936395, 'mean_word_length': 2.871580547112462, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 85, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1175707', 'n_tokens_mistral': 2282, 'n_tokens_neox': 1972, 'n_words': 291}