<commit_before><?php

function google_spreadsheet_to_array($key) {
                // initialize URL
                        $url = 'http://spreadsheets.google.com/feeds/cells/' . $key . '/1/public/values';

                // initialize curl
                        $curl = curl_init();

                // set curl options
                        curl_setopt($curl, CURLOPT_URL, $url);
                        curl_setopt($curl, CURLOPT_HEADER, 0);
                        curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);

                // get the spreadsheet using curl
                        $google_sheet = curl_exec($curl);

                // close the curl connection
                        curl_close($curl);

                // import the xml file into a SimpleXML object
                        $feed = new SimpleXMLElement($google_sheet);

                // get every entry (cell) from the xml object
                        // extract the column and row from the cell's title
                        // e.g. A1 becomes [1][A]

                        $array = array();
                        foreach ($feed->entry as $entry) {
                                $location = (string) $entry->title;
                                preg_match('/(?P<column>[A-Z]+)(?P<row>[0-9]+)/', $location, $matches);
                           $array[$matches['column']][$matches['row']] = (string) $entry->content;
                        }

                // return the array
                return $array;
        }
        
function results_spreadsheet_to_array($key) {
		// initialize URL
				$url = 'http://spreadsheets.google.com/feeds/cells/' . $key . '/1/public/values';

		// initialize curl
				$curl = curl_init();

		// set curl options
				curl_setopt($curl, CURLOPT_URL, $url);
				curl_setopt($curl, CURLOPT_HEADER, 0);
				curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);

		// get the spreadsheet using curl
				$google_sheet = curl_exec($curl);

		// close the curl connection
				curl_close($curl);

		// import the xml file into a SimpleXML object
				$feed = new SimpleXMLElement($google_sheet);

		// get every entry (cell) from the xml object
				// extract the column and row from the cell's title
				// e.g. A1 becomes [1][A]

				$array = array();
				foreach ($feed->entry as $entry) {
						$location = (string) $entry->title;
						preg_match('/(?P<column>[A-Z]+)(?P<row>[0-9]+)/', $location, $matches);
				   $array[$matches['row']][$matches['column']] = (string) $entry->content;
				}

		// return the array
		return $array;
}
        

$responses = results_spreadsheet_to_array('0Av9l84KvUJBWdFNVRGhhc1E1Umc0ZG92d1d4SE13N3c');
$last = count($responses) - 1;
$isFirst = true;	
?>

<!DOCTYPE html>
 <html lang="en">
 <head>
<link href="http://augmenting.me/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />	
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://augmenting.me/trials/before_after/jquery.beforeafter.js"></script>
<script type="text/javascript">
$(function(){
	<?php
					foreach ($responses as $i => $row)
	{
		if ($isFirst) {
		$isFirst = false;
		continue;
		}
		$isLast = ($i == $last);
	echo "$('#container";
	echo $i;
	echo "').beforeAfter();";
}
	?>
});
</script>

 </head>
 <body>
	 <div class="container">
	 	<div class="row clearfix">
	 		<div class="col-md-12 column">
	 			
	<?php
					foreach ($responses as $i => $row)
	{
		if ($isFirst) {
		$isFirst = false;
		continue;
		}
		$isLast = ($i == $last);
		echo '<div class="panel panel-default"><h2>';
		echo $row['A'];
		echo '</h2>';
		echo '<div id="container';
		echo $i;
		echo '"><div>';
		echo '	<img alt="before" src="';
		echo $row['B'];
		echo '" width="';
		echo $row['D'];
		echo '" height="';
		echo $row['E'];
		echo '"></div>';
		echo '<div><img alt="after" src="';
		echo $row['C'];
		echo '" width="';
		echo $row['D'];
		echo '" height="';
		echo $row['E'];
		echo '"></div></div></div>';
			}
					?>
	 </div>
	 		</div>
	 	</div>
	 </div>
     
 </body>
 </html>		                     
<commit_msg>duplicating removed<commit_after><?php

 // found via http://www.timmmmyboy.com/posts/ds106-goes-to-the-movies       
function results_spreadsheet_to_array($key) {
		// initialize URL
				$url = 'http://spreadsheets.google.com/feeds/cells/' . $key . '/1/public/values';

		// initialize curl
				$curl = curl_init();

		// set curl options
				curl_setopt($curl, CURLOPT_URL, $url);
				curl_setopt($curl, CURLOPT_HEADER, 0);
				curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);

		// get the spreadsheet using curl
				$google_sheet = curl_exec($curl);

		// close the curl connection
				curl_close($curl);

		// import the xml file into a SimpleXML object
				$feed = new SimpleXMLElement($google_sheet);

		// get every entry (cell) from the xml object
				// extract the column and row from the cell's title
				// e.g. A1 becomes [1][A]

				$array = array();
				foreach ($feed->entry as $entry) {
						$location = (string) $entry->title;
						preg_match('/(?P<column>[A-Z]+)(?P<row>[0-9]+)/', $location, $matches);
				   $array[$matches['row']][$matches['column']] = (string) $entry->content;
				}

		// return the array
		return $array;
}
        
//REPLACE WITH THE KEY FROM YOUR Google SS
$responses = results_spreadsheet_to_array('0Av9l84KvUJBWdFNVRGhhc1E1Umc0ZG92d1d4SE13N3c');
$last = count($responses) - 1;
$isFirst = true;	
?>

<!DOCTYPE html>
 <html lang="en">
 <head>
<link href="http://augmenting.me/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />	
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/jquery-ui.min.js"></script>
<script type="text/javascript" src="http://augmenting.me/trials/before_after/jquery.beforeafter.js"></script>
<!-- before and after jquery plugin via http://www.catchmyfame.com/catchmyfame-jquery-plugins/jquery-beforeafter-plugin/ -->
<script type="text/javascript">
$(function(){
	<?php
					foreach ($responses as $i => $row)
	{
		if ($isFirst) {
		$isFirst = false;
		continue;
		}
		$isLast = ($i == $last);
	echo "$('#container";
	echo $i;
	echo "').beforeAfter();";
}
	?>
});
</script>

 </head>
 <body>
	 <div class="container">
	 	<div class="row clearfix">
	 		<div class="col-md-12 column">
	 			<div class="jumbotron"><h2><NAME>ard Then and Now</h2>
		 			<p>A collaborative product from the fine people of THAT Camp New Souths, <a href="http://www.flickr.com/photos/vculibraries/sets/72157626912678597/">VCU Libraries</a>, and the wonderful <a href="http://www.catchmyfame.com/catchmyfame-jquery-plugins/jquery-beforeafter-plugin/">people</a> of the <a href="http://www.timmmmyboy.com/posts/ds106-goes-to-the-movies">Internet</a></p>
		 			
		 		</div>
	
	<?php
	
					foreach ($responses as $i => $row)
	{
		if ($isFirst) {
		$isFirst = false;
		continue;
		}
		$isLast = ($i == $last);
		echo '<div class="panel panel-default"><h2>';
		echo $row['A'];
		echo '</h2>';
		echo '<div id="container';
		echo $i;
		echo '"><div>';
		echo '	<img alt="before" src="';
		echo $row['B'];
		echo '" width="';
		echo $row['D'];
		echo '" height="';
		echo $row['E'];
		echo '"></div>';
		echo '<div><img alt="after" src="';
		echo $row['C'];
		echo '" width="';
		echo $row['D'];
		echo '" height="';
		echo $row['E'];
		echo '"></div></div></div>';
			}
					?>
	 </div>
	 		</div>
	 	</div>
	 </div>
     
 </body>
 </html>		                     

{'fraction_non_alphanumeric': 0.18522345647119606, 'fraction_numerical': 0.012012399896667528, 'mean_word_length': 2.608108108108108, 'pattern_counts': {'":': 0, '<': 99, '<?xml version=': 0, '>': 112, 'https://': 0, 'lorem ipsum': 0, 'www.': 5, 'xml': 6}, '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': '3042371', 'n_tokens_mistral': 3004, 'n_tokens_neox': 2582, 'n_words': 567}