<commit_before><?php

/**********************************************************************
*	Huco 617.B2 (Winter 2014)
*	WeatherScraper is an abstract parent class that establishes
*	an interface and basic functionality for a scraper that
*	collects data from one particular weather URL page.
*
*	Children should override three things:
*		• $sitename ==> e.g., "AccuWeather 10-day forecast"
*		• $weatherurl ==> the URL this scraper collects data from
*		• scrape() ==> function where the scraper does its stuff;
*			you may or may not want to break this into sub-functions.
**********************************************************************/

abstract class WeatherScraper {

	protected $weathermanager;			//	the manager object
	protected $weatherdto;				//	a data transport object
	
	//	children should override these:
	protected $sitename = '';			//	e.g., "Weather.com 7-day forecast"
	protected $weatherurl = '';			//	your URL to scrape
	
	
	public function __construct($weathermanager = null) {
		$this->weathermanager = $weathermanager;
		$this->weatherdataobject = new WeatherDTO();
		$this->weatherdto->setSiteName($this->sitename);
	}

	public function log($message = null) {
		if (!empty($this->weathermanager)) $this->weathermanager->log($message);
	}
	
	public function getWeatherDTO() {
		//return a loaded Weather Data Transport Object
		return $this->weatherdto;
	}
	
	
	/*************************************************
	*	Abstract method for children to define
	*************************************************/
	
	//	scrape() should collect data and put it into
	//	the WeatherDTO object. If you can't scrape
	//	data, the object will remain empty.
	public abstract function scrape();


}

?><commit_msg>Modify comment<commit_after><?php

/**********************************************************************
*	Huco 617.B2 (Winter 2014)
*	WeatherScraper is an abstract parent class that establishes
*	an interface and basic functionality for a scraper that
*	collects data from one particular weather URL page.
*
*	Children should override three things:
*		• $sitename ==> e.g., "AccuWeather 10-day forecast"
*		• $weatherurl ==> the URL this scraper collects data from
*		• scrape() ==> function where the scraper does its stuff;
*			you may or may not want to break this into sub-functions.
**********************************************************************/

abstract class WeatherScraper {

	protected $weathermanager;			//	the manager object
	protected $weatherdto;				//	a data transport object
	
	//	children should override these:
	protected $sitename = '';			//	e.g., "Weather.com 7-day forecast"
	protected $weatherurl = '';			//	your URL to scrape
	
	
	public function __construct($weathermanager = null) {
		$this->weathermanager = $weathermanager;
		$this->weatherdataobject = new WeatherDTO();
		$this->weatherdto->setSiteName($this->sitename);
	}

	public function log($message = null) {
		if (!empty($this->weathermanager)) $this->weathermanager->log($message);
	}
	
	public function getWeatherDTO() {
		//return a loaded Weather Data Transport Object
		return $this->weatherdto;
	}
	
	
	/*************************************************
	*	Abstract method for children to define
	*************************************************/
	
	//	scrape() should collect data and put it into
	//	the WeatherDTO object. If you determine it
	//	worked, return true. If you determine that
	//	you can't scrape data, return false.
	public abstract function scrape();


}

?>
{'fraction_non_alphanumeric': 0.23013386499572772, 'fraction_numerical': 0.006266021076616349, 'mean_word_length': 4.522012578616352, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 29, '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': '1954620', 'n_tokens_mistral': 1079, 'n_tokens_neox': 933, 'n_words': 328}