<commit_before><?php

class RSSWidget extends Widget {
	static $db = array(
		"Title" => "Text",
		"RssUrl" => "Text",
		"NumberToShow" => "Int",
	);
	
	static $defaults = array(
		"NumberToShow" => 10,
		"Title" => 'RSS Feed'
	);
	static $cmsTitle = "RSS Feed";
	static $description = "Shows the latest entries of a RSS feed.";
	
	function getCMSFields() {
		return new FieldSet(
			new TextField("Title", _t('RSSWidget.CT', "Custom title for the feed")),
			new TextField("RssUrl", _t('RSSWidget.URL', "URL of RSS Feed")),
			new NumericField("NumberToShow", _t('RSSWidget.NTS', "Number of Items to show"))
		);
	}
	
	function FeedItems() {
		$output = new DataObjectSet();
		$this->feed = new SimplePie($this->RssUrl);
		$this->feed->init();
		if($items = $this->feed->get_items(0, $this->NumberToShow)) {
			foreach($items as $item) {
				$output->push(new ArrayData(array(
					"Title" => $item->get_title(),
					"Link" => $item->get_link()
				)));
			}
			return $output;
		}
	}
}

?><commit_msg>now I see why you need that title function. So added it back<commit_after><?php

class RSSWidget extends Widget {
	static $db = array(
		"RSSTitle" => "Text",
		"RssUrl" => "Text",
		"NumberToShow" => "Int"
	);
	
	static $defaults = array(
		"NumberToShow" => 10,
		"RSSTitle" => 'RSS Feed'
	);
	static $cmsTitle = "RSS Feed";
	static $description = "Shows the latest entries of a RSS feed.";
	
	function getCMSFields() {
		return new FieldSet(
			new TextField("RSSTitle", _t('RSSWidget.CT', "Custom title for the feed")),
			new TextField("RssUrl", _t('RSSWidget.URL', "URL of RSS Feed")),
			new NumericField("NumberToShow", _t('RSSWidget.NTS', "Number of Items to show"))
		);
	}
	function Title() {
		return ($this->RSSTitle) ? $this->RSSTitle : 'RSS Feed';
	}
	
	function FeedItems() {
		$output = new DataObjectSet();
		$this->feed = new SimplePie($this->RssUrl);
		$this->feed->init();
		if($items = $this->feed->get_items(0, $this->NumberToShow)) {
			foreach($items as $item) {
				$output->push(new ArrayData(array(
					"Title" => $item->get_title(),
					"Link" => $item->get_link()
				)));
			}
			return $output;
		}
	}
}

?>
{'fraction_non_alphanumeric': 0.18601398601398603, 'fraction_numerical': 0.002797202797202797, 'mean_word_length': 3.8224719101123594, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 41, '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': '6842296', 'n_tokens_mistral': 888, 'n_tokens_neox': 777, 'n_words': 193}