<commit_before><?php
class OneFortuneADayBridge extends BridgeAbstract {
	const NAME = 'One Fortune a Day';
	const URI = 'https://github.com/fulmeek';
	const DESCRIPTION = 'Get a fortune quote every single day.';
	const MAINTAINER = 'fulmeek';
	const PARAMETERS = array(array(
		'time' => array(
			'name'		=> 'Time in UTC',
			'type'		=> 'list',
			'values'	=> array(
				'0:00'	=> 0,
				'1:00'	=> 1,
				'2:00'	=> 2,
				'3:00'	=> 3,
				'4:00'	=> 4,
				'5:00'	=> 5,
				'6:00'	=> 6,
				'7:00'	=> 7,
				'8:00'	=> 8,
				'9:00'	=> 9,
				'10:00'	=> 10,
				'11:00'	=> 11,
				'12:00'	=> 12,
				'13:00'	=> 13,
				'14:00'	=> 14,
				'15:00'	=> 15,
				'16:00'	=> 16,
				'17:00'	=> 17,
				'18:00'	=> 18,
				'19:00'	=> 19,
				'20:00'	=> 20,
				'21:00'	=> 21,
				'22:00'	=> 22,
				'23:00'	=> 23,
			),
			'defaultValue' => 5
		),
		'lucky' => array(
			'name' => 'Lucky number (optional)',
			'type' => 'text'
		)
	));

	const LIMIT_ITEMS = 7;
	const DAY_SECS = 86400;

	public function getDescription(){
		return self::DESCRIPTION . '<br/>Set a lucky number to get your personal quotes, like ' . mt_rand();
	}

	public function collectData() {
		$time = gmmktime((int)$this->getInput('time'), 0, 0);
		if ($time > time())
			$time -= self::DAY_SECS;

		for ($i = self::LIMIT_ITEMS; $i > 0; --$i) {
			$seed = date('Ymd', $time) . $this->getInput('lucky');
			$quote = $this->getQuote($seed);

			$item['title']		= strftime('%A, %x', $time);
			$item['content']	= htmlentities($quote, ENT_QUOTES, 'UTF-8');
			$item['timestamp']	= $time;
			$item['uid']		= hash('sha1', $seed);
<commit_msg>[OneFortuneADayBridge] use date in UTC for seed (#1059)<commit_after><?php
class OneFortuneADayBridge extends BridgeAbstract {
	const NAME = 'One Fortune a Day';
	const URI = 'https://github.com/fulmeek';
	const DESCRIPTION = 'Get a fortune quote every single day.';
	const MAINTAINER = 'fulmeek';
	const PARAMETERS = array(array(
		'time' => array(
			'name'		=> 'Time in UTC',
			'type'		=> 'list',
			'values'	=> array(
				'0:00'	=> 0,
				'1:00'	=> 1,
				'2:00'	=> 2,
				'3:00'	=> 3,
				'4:00'	=> 4,
				'5:00'	=> 5,
				'6:00'	=> 6,
				'7:00'	=> 7,
				'8:00'	=> 8,
				'9:00'	=> 9,
				'10:00'	=> 10,
				'11:00'	=> 11,
				'12:00'	=> 12,
				'13:00'	=> 13,
				'14:00'	=> 14,
				'15:00'	=> 15,
				'16:00'	=> 16,
				'17:00'	=> 17,
				'18:00'	=> 18,
				'19:00'	=> 19,
				'20:00'	=> 20,
				'21:00'	=> 21,
				'22:00'	=> 22,
				'23:00'	=> 23,
			),
			'defaultValue' => 5
		),
		'lucky' => array(
			'name' => 'Lucky number (optional)',
			'type' => 'text'
		)
	));

	const LIMIT_ITEMS = 7;
	const DAY_SECS = 86400;

	public function getDescription(){
		return self::DESCRIPTION . '<br/>Set a lucky number to get your personal quotes, like ' . mt_rand();
	}

	public function collectData() {
		$time = gmmktime((int)$this->getInput('time'), 0, 0);
		if ($time > time())
			$time -= self::DAY_SECS;

		for ($i = self::LIMIT_ITEMS; $i > 0; --$i) {
			$seed = gmdate('Ymd', $time) . $this->getInput('lucky');
			$quote = $this->getQuote($seed);

			$item['title']		= strftime('%A, %x', $time);
			$item['content']	= htmlentities($quote, ENT_QUOTES, 'UTF-8');
			$item['timestamp']	= $time;
			$item['uid']		= hash('sha1', $seed);

{'fraction_non_alphanumeric': 0.23288093769278223, 'fraction_numerical': 0.0851326341764343, 'mean_word_length': 2.9356796116504853, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 79, 'https://': 2, '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': '949646', 'n_tokens_mistral': 1823, 'n_tokens_neox': 1415, 'n_words': 319}