<commit_before><?php
/*
OpenWeatherMap API example
See documentation for more info: http://openweathermap.org/API
*/

/*
Get the 7-day forecast for London in imperial (Fahrenheit) units, with response in JSON format:
Parameters in query string:
q=London : search string
&mode=json : response format
&units=imperial : Fahrenheit
&cnt=7 : count, number of days to report

*/
$data = file_get_contents('http://api.openweathermap.org/data/2.5/forecast/daily?q=London&mode=json&units=imperial&cnt=7');
//$url = 'http://api.openweathermap.org/data/2.5/weather?q=London';
//$data = file_get_contents($url);
// turn the JSON data into a PHP object
$json = json_decode($data,true);

var_dump($json);

//var_dump($json); //for debugging
/*foreach ($json->list as $myday){
	echo '<li>';
	echo date('M d',$myday->dt); // format the timestamp as a human-readable date
	echo ': '.round($myday->temp->day) . 'F';
	echo '</li>';
}*/<commit_msg>updates to open weather map API script<commit_after><?php
/*
OpenWeatherMap API example
See documentation for more info: http://openweathermap.org/API
*/

/*
Get the 7-day forecast for London in imperial (Fahrenheit) units, with response in JSON format:
Parameters in query string:
q=London : search string
&mode=json : response format
&units=imperial : Fahrenheit
&cnt=7 : count, number of days to report

*/
$url = 'http://api.openweathermap.org/data/2.5/forecast/daily?q=London&mode=json&units=imperial&cnt=7';
$data = file_get_contents($url);
//debug: check to see the URL you're using.
//echo $url;

// turn the JSON data into a PHP array
$json_array = json_decode($data,true);

//var_dump($json_array);

$condition = $json_array['list'][0]['weather'][0]['main'];
echo "Condition on the first day is: $condition"; 

// Show the temperatures for all 7 days
foreach ($json_array['list'] as $myday){
	echo '<li>';
	echo date('M d',$myday['dt']); // format the timestamp as a human-readable date
	echo ': '.round($myday['temp']['day']) . 'F';
	echo '</li>';
}
{'fraction_non_alphanumeric': 0.1659959758551308, 'fraction_numerical': 0.007545271629778672, 'mean_word_length': 4.955089820359281, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '2237304', 'n_tokens_mistral': 675, 'n_tokens_neox': 654, 'n_words': 198}