<commit_before><?php

namespace App\Controllers;

class Homepage extends \Katu\Controller {

	static function index() {
		$movies = \Katu\Utils\Cache::get(function() {

			$res = \Katu\Utils\Cache::getUrl('https://docs.google.com/spreadsheets/d/1_H6y1uS-yGkZGfdMtS2kFkCw5Fgml35PDJcK0ZcWr_0/pubhtml', 3600);
			$dom = \Katu\Utils\DOM::crawlHtml($res);

			$movies = array_slice($dom->filter('table tbody tr')->each(function($e) {
				return \App\Classes\Movie::createFromTable($e);
			}), 2);

			array_multisort(array_map(function($i) {
				return $i->dateTime->getTimestamp();
			}, $movies), $movies);

			return $movies;

		}, 3600);

		static::$data['movies'] = array_filter($movies, function($i) {
			return $i->dateTime->getTimestamp() <= (new \Katu\Utils\DateTime('+1 week'))->getTimestamp();
		});

		static::$data['_page']['title'] = 'Letňáky v Brně';

		return static::render("Homepage/index");
	}

}<commit_msg>incremental<commit_after><?php

namespace App\Controllers;

class Homepage extends \Katu\Controller {

	static function index() {
		$movies = \Katu\Utils\Cache::get(function() {

			$res = \Katu\Utils\Cache::getUrl('https://docs.google.com/spreadsheets/d/1_H6y1uS-yGkZGfdMtS2kFkCw5Fgml35PDJcK0ZcWr_0/pubhtml', 3600);
			$dom = \Katu\Utils\DOM::crawlHtml($res);

			$movies = array_slice($dom->filter('table tbody tr')->each(function($e) {
				return \App\Classes\Movie::createFromTable($e);
			}), 2);

			array_multisort(array_map(function($i) {
				return $i->dateTime->getTimestamp();
			}, $movies), $movies);

			return $movies;

		}, 3600);

		static::$data['movies'] = array_filter($movies, function($i) {
			return
				$i->dateTime->getTimestamp() <= (new \Katu\Utils\DateTime('+1 week'))->getTimestamp()
				&&
				$i->dateTime->isInFuture()
				;
		});

		static::$data['_page']['title'] = 'Letňáky v Brně';

		return static::render("Homepage/index");
	}

}
{'fraction_non_alphanumeric': 0.19957649550026468, 'fraction_numerical': 0.02011646373742721, 'mean_word_length': 4.625, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 19, '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': '2856974', 'n_tokens_mistral': 821, 'n_tokens_neox': 720, 'n_words': 93}