<commit_before><?php
	
	// Start a session on the server.
	session_start();
	
	// Include any required components.
	include_once("prisoner.authentication.php");
	include_once("prisoner.core.php");

	// Set session.
	set_session();
	$session_cookie = $_SESSION["PRISession_Cookie"];
	
	// Get info from Facebook.
	$profile_info = get_response("/get/Facebook/User/session:Facebook.id", $session_cookie);	# Profile.
	$friends_info = get_response("/get/Facebook/Friends/session:Facebook.id", $session_cookie);	# Friends.
	$music_info = get_response("/get/Facebook/Music/session:Facebook.id", $session_cookie);	# Favourite bands.
	$book_info = get_response("/get/Facebook/Book/session:Facebook.id", $session_cookie);	# Favourite books.

	$display_name = $profile_info["_displayName"];
	$username = $profile_info["_username"];
	$first_name = $profile_info["_firstName"];
	$last_name = $profile_info["_lastName"];
	$gender = $profile_info["_gender"];
	$email_address = $profile_info["_email"];
	$profile_pic = $profile_info["_image"]["_fullImage"];
	$birthday = $profile_info["_birthday"];
	$last_updated = $profile_info["_updatedTime"];
	$religion = $profile_info["_religion"];
	$bio = $profile_info["_bio"];
	$interested_in = $profile_info["_interestedIn"];
	
	echo "<h1>Hello " . $first_name . " " . $last_name ."</h1>" .
	"<img alt='Facebook Profile Picture' src='" . $profile_pic . "' />" .
	"<p>Here's some of the information we grabbed about you:</p>" .
	"<ul>" .
	"<li>Name: " . $first_name . " " . $last_name . "</li>" .
	"<li>Gender: " . $gender . "</li>" .
	"<li>Birthday: " . $birthday . "</li>" .
	"<li>Email Address: " . $email_address . "</li>" .
	"<li>Religion: " . $religion . "</li>" .
	"<li>Last Updated Facebook: " . $last_updated . "</li>" .
	"<li>Interested In: " . $interested_in[0] . "</li>" .
	"</ul>";
	
	// Get the returned array of friends.
	$friends_array = $friends_info["_objects"];
 	$rand_keys = array_rand($friends_array, 10);
	
 	echo "<p>Some of your friends include:</p><ul>";
 	
 	foreach ($rand_keys as $key) {
 		echo "<li>" . $friends_array[$key]["_displayName"] . "</li>";
 	}
	
 	echo "</ul>";
 	
 	// Get the returned array of music.
 	$music_array = $music_info["_objects"];
 	if (sizeof($music_array) > 0) {
 		$rand_keys = array_rand($music_array, 5);
 		
 		echo "<p>You like:</p><ul>";
 		
 		foreach ($rand_keys as $key) {
 			echo "<li>" . $music_array[$key]["_displayName"] . "</li>";
 		}
 		
 		echo "</ul>";
 	}
 	
 	else {
 		echo "<p>You haven't added your musical preferences to Facebook.</p>";
 	}
 	
 	// Get the returned array of books.
 	$books_array = $book_info["_objects"];
 	if (sizeof($books_array) > 0) {
 		$rand_keys = array_rand($books_array, 5);
 			
 		echo "<p>You like:</p><ul>";
 			
 		foreach ($rand_keys as $key) {
 			echo "<li>" . $books_array[$key]["_displayName"] . "</li>";
 		}
 			
 		echo "</ul>";
 	}
 	
 	else {
 		echo "<p>You haven't added your literature preferences to Facebook.</p>";
 	}
	

?><commit_msg>Added example where policy doesn't allow data to be grabbed.<commit_after><?php
	
	// Start a session on the server.
	session_start();
	
	// Include any required components.
	include_once("prisoner.authentication.php");
	include_once("prisoner.core.php");

	// Set session.
	set_session();
	$session_cookie = $_SESSION["PRISession_Cookie"];
	
	// Get info from Facebook.
	$profile_info = get_response("/get/Facebook/User/session:Facebook.id", $session_cookie);	# Profile.
	$friends_info = get_response("/get/Facebook/Friends/session:Facebook.id", $session_cookie);	# Friends.
	$music_info = get_response("/get/Facebook/Music/session:Facebook.id", $session_cookie);	# Favourite bands.
	$book_info = get_response("/get/Facebook/Book/session:Facebook.id", $session_cookie);	# Favourite books.

	$display_name = $profile_info["_displayName"];
	$username = $profile_info["_username"];
	$first_name = $profile_info["_firstName"];
	$last_name = $profile_info["_lastName"];
	$gender = $profile_info["_gender"];
	$email_address = $profile_info["_email"];
	$profile_pic = $profile_info["_image"]["_fullImage"];
	$birthday = $profile_info["_birthday"];
	$last_updated = $profile_info["_updatedTime"];
	$religion = $profile_info["_religion"];
	$bio = $profile_info["_bio"];
	$interested_in = $profile_info["_interestedIn"];
	
	echo "<h1>Hello " . $first_name . " " . $last_name ."</h1>" .
	"<img alt='Facebook Profile Picture' src='" . $profile_pic . "' />" .
	"<p>Here's some of the information we grabbed about you:</p>" .
	"<ul>" .
	"<li>Name: " . $first_name . " " . $last_name . "</li>" .
	"<li>Gender: " . $gender . "</li>" .
	"<li>Birthday: " . $birthday . "</li>" .
	"<li>Email Address: " . $email_address . "</li>" .
	"<li>Religion: " . $religion . "</li>" .
	"<li>Last Updated Facebook: " . $last_updated . "</li>" .
	"<li>Interested In: " . $interested_in[0] . "</li>" .
	"</ul>";
	
	// Get the returned array of friends.
	$friends_array = $friends_info["_objects"];
 	$rand_keys = array_rand($friends_array, 10);
	
 	echo "<p>Some of your friends include:</p><ul>";
 	
 	foreach ($rand_keys as $key) {
 		echo "<li>" . $friends_array[$key]["_displayName"] . "</li>";
 	}
	
 	echo "</ul>";
 	
 	// Get the returned array of music.
 	$music_array = $music_info["_objects"];
 	if (sizeof($music_array) > 0) {
 		$rand_keys = array_rand($music_array, 5);
 		
 		echo "<p>You like:</p><ul>";
 		
 		foreach ($rand_keys as $key) {
 			echo "<li>" . $music_array[$key]["_displayName"] . "</li>";
 		}
 		
 		echo "</ul>";
 	}
 	
 	else {
 		echo "<p>You haven't added your musical preferences to Facebook.</p>";
 	}
 	
 	
 	// Get a random friend's ID.
 	$rand_friend = array_rand($friends_array);
 	$rand_id = $friends_array[$rand_friend]["_id"];
 	echo "<p>Random friend ID: " . $rand_id . "</p>";
 	
 	// Get info for random friend.
 	$profile_info = get_response("/get/Facebook/User/literal:" . $rand_id, $session_cookie);	# Profile.
 	var_dump($profile_info);

?>
{'fraction_non_alphanumeric': 0.19805140265412396, 'fraction_numerical': 0.0026877204770703847, 'mean_word_length': 4.016006739679865, 'pattern_counts': {'":': 0, '<': 85, '<?xml version=': 0, '>': 88, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 26, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '472064', 'n_tokens_mistral': 2334, 'n_tokens_neox': 2118, 'n_words': 426}