<commit_before><?php

/**
 * used to read the weather from NOAA, requires sb_Weather_Feed
 *
 * @author: Paul 05/21/2005
 * @version 2.11  12/08/2008
 * @package Web
 * 
 */
class sb_Web_Weather{

	/**
	 * 
	 * Looks up the weather feed from the given feed url, There are other properties which can be accessed from the feed to see them uncomment print_r($xml) line. I would suggest always storing the json_encoded data in a session so that you only need to access the weather server once per visit as it can be slow and there is no need to check the weather more than once per visit.
	 *
	 * @param string $feed The url to the weather feed from NOAA e.g. 
	 * @return object weather_feed
	 * @example 
	 * $weather = sb_Weather::fetch('http://www.nws.noaa.gov/data/current_obs/KBUF.xml');
		print_r($weather);
		echo json_encode($weather);
	 */
	public static function fetch($feed){

		$xml = simplexml_load_string(file_get_contents($feed));
	
		$weather = new sb_Web_WeatherFeed();
		if(is_object($xml)){
			$weather->condition = sprintf($xml->weather);
			$weather->temp_f = sprintf($xml->temp_f);
			$weather->temp_c = sprintf($xml->temp_c);
			$weather->wind_mph = sprintf($xml->wind_mph);
			$weather->icon = sprintf($xml->icon_url_base.$xml->icon_url_name);
		}
		
		return $weather;

	}
}

?><commit_msg>updated sb_Web_Weather phpdoc example as it still refered to it as sb_Weather<commit_after><?php

/**
 * used to read the weather from NOAA, requires sb_Weather_Feed
 *
 * @author: Paul 05/21/2005
 * @version 2.11  12/08/2008
 * @package Web
 * 
 */
class sb_Web_Weather{

	/**
	 * 
	 * Looks up the weather feed from the given feed url, There are other properties which can be accessed from the feed to see them uncomment print_r($xml) line. I would suggest always storing the json_encoded data in a session so that you only need to access the weather server once per visit as it can be slow and there is no need to check the weather more than once per visit.
	 *
	 * @param string $feed The url to the weather feed from NOAA e.g. 
	 * @return object weather_feed
	 * @example 
	 * $weather = sb_Web_Weather::fetch('http://www.nws.noaa.gov/data/current_obs/KBUF.xml');
		print_r($weather);
	 */
	public static function fetch($feed){

		$xml = simplexml_load_string(file_get_contents($feed));
	
		$weather = new sb_Web_WeatherFeed();
		if(is_object($xml)){
			$weather->condition = sprintf($xml->weather);
			$weather->temp_f = sprintf($xml->temp_f);
			$weather->temp_c = sprintf($xml->temp_c);
			$weather->wind_mph = sprintf($xml->wind_mph);
			$weather->icon = sprintf($xml->icon_url_base.$xml->icon_url_name);
		}
		
		return $weather;

	}
}

?>
{'fraction_non_alphanumeric': 0.12021036814425244, 'fraction_numerical': 0.014274981217129978, 'mean_word_length': 3.949814126394052, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 22}, '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': '713278', 'n_tokens_mistral': 960, 'n_tokens_neox': 846, 'n_words': 275}