From 2e2d717e4b80298c32a006ce84df1763228d0231 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 9 Feb 2024 23:07:52 +0100 Subject: [PATCH] =?utf8?q?=F0=9F=91=BD=EF=B8=8F=20Update=20Savoy=20ticket?= =?utf8?q?=20filter?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- build.gradle | 4 +- .../filters/webpages/savoy/MovieExtractor.java | 93 -- .../filters/webpages/savoy/MovieExtractor.kt | 42 + .../filters/webpages/savoy/MovieExtractorTest.java | 147 +- .../rhynodge/filters/webpages/savoy/savoy.html | 1681 ++------------------ 5 files changed, 289 insertions(+), 1678 deletions(-) delete mode 100644 src/main/java/net/pterodactylus/rhynodge/filters/webpages/savoy/MovieExtractor.java create mode 100644 src/main/kotlin/net/pterodactylus/rhynodge/filters/webpages/savoy/MovieExtractor.kt diff --git a/build.gradle b/build.gradle index 55bd153..04c938d 100644 --- a/build.gradle +++ b/build.gradle @@ -43,9 +43,7 @@ dependencies { compile group: "org.jsoup", name: "jsoup", version: "1.16.1" compile group: "javax.mail", name: "mail", version: "1.4.6-rc1" compile group: "org.apache.commons", name: "commons-lang3", version: "3.1" - compile group: "com.fasterxml.jackson.core", name: "jackson-core", version: "2.1.2" - compile group: "com.fasterxml.jackson.core", name: "jackson-annotations", version: "2.1.2" - compile group: "com.fasterxml.jackson.core", name: "jackson-databind", version: "2.1.2" + compile group: "com.fasterxml.jackson.core", name: "jackson-databind", version: "2.15.1" compile group: "com.google.inject", name: "guice", version: "4.0" compile group: "org.jetbrains.kotlinx", name: "kotlinx-html-jvm", version: "0.7.1" compile group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2' diff --git a/src/main/java/net/pterodactylus/rhynodge/filters/webpages/savoy/MovieExtractor.java b/src/main/java/net/pterodactylus/rhynodge/filters/webpages/savoy/MovieExtractor.java deleted file mode 100644 index ae7d072..0000000 --- a/src/main/java/net/pterodactylus/rhynodge/filters/webpages/savoy/MovieExtractor.java +++ /dev/null @@ -1,93 +0,0 @@ -package net.pterodactylus.rhynodge.filters.webpages.savoy; - -import static java.time.format.DateTimeFormatter.ofPattern; -import static java.util.Optional.empty; -import static java.util.Optional.of; - -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.LocalTime; -import java.time.format.DateTimeFormatter; -import java.util.HashSet; -import java.util.Optional; -import java.util.Set; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import org.jsoup.nodes.Document; -import org.jsoup.nodes.Element; - -/** - * Extracts {@link Movie} information from an HTML document. - * - * @author David ‘Bombe’ Roden - */ -public class MovieExtractor { - - private static final Pattern datePattern = Pattern.compile(".*([0-9]{2}\\.[0-9]{2}\\.[0-9]{2}).*"); - private static final Pattern timePattern = Pattern.compile(".*([0-9]{2}:[0-9]{2}).*"); - private static final DateTimeFormatter dateFormatter = ofPattern("dd.MM.uu"); - private static final DateTimeFormatter timeFormatter = ofPattern("HH:mm"); - - public Set getMovies(Document document) { - Set movies = new HashSet<>(); - for (Element movieElement : document.select(".tx-spmovies-pi1-listrow")) { - String name = movieElement.select(".tx-spmovies-pi1-header h1").text(); - Movie movie = new Movie(name); - for (TicketLink ticketLink : extractTicketLinks(movieElement)) { - movie.addTicketLink(ticketLink); - } - movies.add(movie); - } - return movies; - } - - private Iterable extractTicketLinks(Element movieElement) { - Set ticketLinks = new HashSet<>(); - int dateCellIndex = 1; - for (Element dateCell : movieElement.select(".tx-spmovies-pi1-date-column")) { - Optional dateString = extractDateString(dateCell); - if (!dateString.isPresent()) { - continue; - } - for (Element timeCell : getTimeCells(movieElement, dateCellIndex++)) { - Optional timeString = extractTimeString(timeCell.select("a").text()); - if (!timeString.isPresent()) { - continue; - } - LocalDateTime localDateTime = getPresentationTime(dateString, timeString); - String link = timeCell.select("a").attr("href"); - TicketLink ticketLink = new TicketLink(localDateTime, link); - ticketLinks.add(ticketLink); - } - } - return ticketLinks; - } - - private LocalDateTime getPresentationTime(Optional dateString, Optional timeString) { - LocalDate date = LocalDate.parse(dateString.get(), dateFormatter); - LocalTime localTime = LocalTime.parse(timeString.get(), timeFormatter); - return date.atTime(localTime); - } - - private Optional extractTimeString(String cellContent) { - Matcher timeMatcher = timePattern.matcher(cellContent); - if (!timeMatcher.matches() || timeMatcher.groupCount() < 1) { - return empty(); - } - return of(timeMatcher.group(1)); - } - - private Iterable getTimeCells(Element movieElement, int dateCellIndex) { - return movieElement.select(".tx-spmovies-pi1-shows:eq(" + dateCellIndex + ") div.time"); - } - - private Optional extractDateString(Element dateCell) { - Matcher matcher = datePattern.matcher(dateCell.text()); - if (!matcher.matches() || matcher.groupCount() < 1) { - return empty(); - } - return of(matcher.group(1)); - } - -} diff --git a/src/main/kotlin/net/pterodactylus/rhynodge/filters/webpages/savoy/MovieExtractor.kt b/src/main/kotlin/net/pterodactylus/rhynodge/filters/webpages/savoy/MovieExtractor.kt new file mode 100644 index 0000000..a49c280 --- /dev/null +++ b/src/main/kotlin/net/pterodactylus/rhynodge/filters/webpages/savoy/MovieExtractor.kt @@ -0,0 +1,42 @@ +package net.pterodactylus.rhynodge.filters.webpages.savoy + +import com.fasterxml.jackson.databind.JsonNode +import com.fasterxml.jackson.databind.ObjectMapper +import org.jsoup.nodes.Document +import java.time.LocalDateTime +import java.time.format.DateTimeFormatter + +class MovieExtractor { + + fun getMovies(document: Document) = + document.select("body script#flebbe-state") + .dataNodes().joinToString("").unescape() + .let(objectMapper::readTree) + .get("G./api/v1/de/config?").get("body").asText() + .let(objectMapper::readTree) + .get("movie_list") + .map { it.extractMovie() } + .toSet() + + private fun String.unescape() = this + .replace("&q;", "\"") + .replace("&a;", "&") + .replace("&s;", "'") + .replace("&l;", "<") + .replace("&g;", ">") + + private fun JsonNode.extractMovie() = Movie(get("name").asText()).apply { + this@extractMovie.get("performances") + .map { performance -> + val begin = LocalDateTime.parse(performance.get("begin").asText(), dateFormat) + val slug = performance.get("slug").asText() + val link = "https://savoy.premiumkino.de/vorstellung/${slug}/${String.format("%tY% movies; public MovieExtractorTest() throws IOException { - document = loadDocument("savoy.html", "http://foo"); + document = loadDocument("savoy.html", "https://savoy.premiumkino.de/programmwoche"); movies = movieExtractor.getMovies(document); } @@ -44,23 +44,110 @@ public class MovieExtractorTest { @Test public void moviesAreLocated() throws IOException { - assertThat(movies, notNullValue()); assertThat(movies, containsInAnyOrder( - movie("22 Jump Street (OV)", of(2014, 7, 30, 20, 15), of(2014, 7, 31, 20, 15), of(2014, 8, 1, 22, 30), of(2014, 8, 2, 20, 0), of(2014, 8, 2, 22, 45), of(2014, 8, 3, 17, 30), of(2014, 8, 4, 17, 30), of(2014, 8, 5, 20, 0)), - movie("How to Train Your Dragon 2 (3D/OV)", of(2014, 7, 30, 17, 45), of(2014, 8, 1, 14, 15), of(2014, 8, 2, 17, 30), of(2014, 8, 3, 15, 0), of(2014, 8, 4, 20, 0)), - movie("Jersey Boys (OV)", of(2014, 7, 31, 17, 15), of(2014, 8, 1, 16, 30), of(2014, 8, 3, 20, 0), of(2014, 8, 5, 17, 0)), - movie("FILM CLUB presents: Ghostbusters (OV)", of(2014, 8, 1, 19, 30)), - movie("Transformers: Age of Extinction (3D/OV)", of(2014, 8, 2, 14, 0)), - movie("Dawn of the Planet of the Apes (3D/OV)"), - movie("Traumkino: Yves Saint Laurent (Deutsche Fassung)"), - movie("Hector and the Search for Happiness (OV)"), - movie("The Expendables 3 (OV)"), - movie("Doctor Who: Deep Breath"), - movie("Traumkino: Boyhood (Deutsche Sprachfassung)") + movie("All of Us Strangers", + new Pair<>(of(2024, 2, 9, 16, 15), "https://savoy.premiumkino.de/vorstellung/all-of-us-strangers/20240209/1615/HkKdhlHMvtfSMy1fqYYtYuVdgGIKtnT7i7ddY5jzRfY~"), + new Pair<>(of(2024, 2, 10, 22, 15), "https://savoy.premiumkino.de/vorstellung/all-of-us-strangers/20240210/2215/znWqm8FQUNSbrODY_A0jw8Au2nW6uSqbFE7Co8UgQv0~"), + new Pair<>(of(2024, 2, 11, 20, 15), "https://savoy.premiumkino.de/vorstellung/all-of-us-strangers/20240211/2015/I642oTHBKpy7sz2RULHIQK6cykSCPi57_c0TApiKbUk~"), + new Pair<>(of(2024, 2, 12, 17, 15), "https://savoy.premiumkino.de/vorstellung/all-of-us-strangers/20240212/1715/2lEiqVP1hueXZhWwy9FSUfRgFKf8iTCKRMdJOTfBf8A~"), + new Pair<>(of(2024, 2, 13, 20, 30), "https://savoy.premiumkino.de/vorstellung/all-of-us-strangers/20240213/2030/M0mIWdKm5gZkan5na6zOVFBzsHWAHhqod8RCmG2Fr0Y~"), + new Pair<>(of(2024, 2, 14, 14, 30), "https://savoy.premiumkino.de/vorstellung/all-of-us-strangers/20240214/1430/VZhgxh4PZutWWlLPEAe9dfOUJkB3sLnXzWoduICJYTk~") + ), + movie("Dune", + new Pair<>(of(2024, 2, 9, 19, 0), "https://savoy.premiumkino.de/vorstellung/dune/20240209/1900/o9jDuan4yyxaW7-Jg3hCJpiAM4CLZei8J2IX-O5-hA0~"), + new Pair<>(of(2024, 2, 10, 15, 30), "https://savoy.premiumkino.de/vorstellung/dune/20240210/1530/jXbZnYD8R5djVnj3Ojjcsc9qdSJ0JBMVhn7PeP88HyY~"), + new Pair<>(of(2024, 2, 11, 13, 30), "https://savoy.premiumkino.de/vorstellung/dune/20240211/1330/aJmlM8wOaGl_jtuWDvWG9TF7RR1zRpNrSZeArCBhn90~"), + new Pair<>(of(2024, 2, 12, 20, 0), "https://savoy.premiumkino.de/vorstellung/dune/20240212/2000/2KLOCZy5zU060zKj-4zafxm3oalEyT4tNi2Fxnw5D7E~"), + new Pair<>(of(2024, 2, 13, 17, 0), "https://savoy.premiumkino.de/vorstellung/dune/20240213/1700/QCphOtH-WrZ2tRbENwaxXPskrN2gH3I8dHR0Y5L3l0Y~") + ), + movie("SAVOY Sneak-Preview", + new Pair<>(of(2024, 2, 9, 22, 30), "https://savoy.premiumkino.de/vorstellung/sneak-preview/20240209/2230/GtYBcOR_Jy7a8xDxwwPHI0wfY_v_Ep2P6rV0w4wJ7SM~"), + new Pair<>(of(2024, 2, 16, 22, 0), "https://savoy.premiumkino.de/vorstellung/sneak-preview/20240216/2200/ZRC7iir9Hu8nIpH1PsiA_UDvckcj7yGqgMEYXHAs9Qw~") + ), + movie("Der Junge und der Reiher", + new Pair<>(of(2024, 2, 10, 12, 30), "https://savoy.premiumkino.de/vorstellung/der-junge-und-der-reiher/20240210/1230/F0atZERI4Gssj3LGC-2fQlLF3rM9Uk8IbpOzHaXyx7w~") + ), + movie("Poor Things", + new Pair<>(of(2024, 2, 10, 19, 0), "https://savoy.premiumkino.de/vorstellung/poor-things/20240210/1900/SqolavKZAlBMZH_JAN-OqdZqowBv-aRqhPGHvPTphao~"), + new Pair<>(of(2024, 2, 11, 17, 0), "https://savoy.premiumkino.de/vorstellung/poor-things/20240211/1700/UrS33k-jY7_ZAsm4B7wydy0SBfdVjdd73On68HtIy9E~"), + new Pair<>(of(2024, 2, 13, 13, 45), "https://savoy.premiumkino.de/vorstellung/poor-things/20240213/1345/gma7KCzuaJQCSoBm8NMJb3ATjtMISm4M9IiwiVNpXpw~"), + new Pair<>(of(2024, 2, 14, 17, 15), "https://savoy.premiumkino.de/vorstellung/poor-things/20240214/1715/cBjQj4qRrJaSX3m_acvfxNL1Tclg0Rrt_X63Md0rkEw~") + ), + movie("Vergiss mein nicht- Eternal Sunshine of the Spotless Mind", + new Pair<>(of(2024, 2, 14, 20, 30), "https://savoy.premiumkino.de/vorstellung/vergiss-mein-nicht-eternal-sunshine-of-the-spotless-mind/20240214/2030/QqoCtd4ls09AD04rGSNh8qPkf02rcRzp2wFfF2BoobE~") + ), + movie("Bob Marley: One Love", + new Pair<>(of(2024, 2, 15, 20, 15), "https://savoy.premiumkino.de/vorstellung/bob-marley-one-love/20240215/2015/q4dxyPDNVvZDEeIuh1r9Y4OJ7UK36CKSr2d7p3h9LMs~") + ), + movie("The Hateful 8", + new Pair<>(of(2024, 2, 18, 19, 45), "https://savoy.premiumkino.de/vorstellung/the-hateful-8/20240218/1945/dusKDbTYgF79OipGmQO0Q4P5K02rclkjIV9At8qKfOA~") + ), + movie("Prinzessin Mononoke", + new Pair<>(of(2024, 2, 19, 20, 15), "https://savoy.premiumkino.de/vorstellung/prinzessin-mononoke/20240219/2015/LmbLtOrTZxBgPlBMzoRZ4_C-PfO64GeXNIKr5KGs-2M~"), + new Pair<>(of(2024, 2, 22, 20, 15), "https://savoy.premiumkino.de/vorstellung/prinzessin-mononoke/20240222/2015/mvbGK2fA5AgPbADOzm7sqFYYzm2qdqqdwqdLu4rMPrg~") + ), + movie("Das fünfte Element (Best of Cinema)", + new Pair<>(of(2024, 2, 20, 20, 30), "https://savoy.premiumkino.de/vorstellung/das-fuenfte-element-best-of-cinema/20240220/2030/QcJZ5Yh8P2j_HKLSP8cjcXsqkbdqYdYGTexCF3RF2R4~") + ), + movie("Heaven Can Wait - wir leben jetzt", + new Pair<>(of(2024, 2, 21, 11, 0), "https://savoy.premiumkino.de/vorstellung/heaven-can-wait-wir-leben-jetzt/20240221/1100/GW7pwEYabwN3-e8uTGmSPTfdbyXoKe4la-B2L1SI8XI~") + ), + movie("Demon Slayer: Kimetsu no yaiba - Zum Training der Säulen", + new Pair<>(of(2024, 2, 27, 20, 30), "https://savoy.premiumkino.de/vorstellung/demon-slayer-kimetsu-no-yaiba-zum-training-der-saeulen/20240227/2030/UsAsz9NQPZGfdyLelrAHZ50MXeoElhNIPcgg3unBR0o~") + ), + movie("Double Feature DUNE 1&2", + new Pair<>(of(2024, 2, 28, 17, 30), "https://savoy.premiumkino.de/vorstellung/double-feature-dune-1und2/20240228/1730/Ni6Yo0fA4k7gEZiJB8Cnq33Axjnw85JBG2lBIVRwYok~"), + new Pair<>(of(2024, 3, 3, 10, 0), "https://savoy.premiumkino.de/vorstellung/double-feature-dune-1und2/20240303/1000/AXcH4nnYJB9Ar0aR5zFl3Bfa238POna3UVY66_nHL6c~") + ), + movie("Dune: Part Two", + new Pair<>(of(2024, 2, 29, 12, 30), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240229/1230/Osq78ODtBKchFFx1HgAmEPAAIWLC6JgxWqC638UaRws~"), + new Pair<>(of(2024, 2, 29, 16, 15), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240229/1615/hJ3kXaFB-LjfZu2pYBVx0R_2UoqOJANwWX_AS4KW6FI~"), + new Pair<>(of(2024, 2, 29, 20, 0), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240229/2000/EwA7Z5KlKNnIr0e4o_tXGpYp6xN90juBl92wcTVIZ-Q~"), + new Pair<>(of(2024, 3, 1, 13, 45), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240301/1345/-kxmskcNJYhWCr9z5MfK0p2w2qlu3CDu8rVtDLmxSQA~"), + new Pair<>(of(2024, 3, 1, 17, 30), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240301/1730/yXQQSsMug0nRQGN1BNpBXEA3Udf_asggPHwk4a4zdBE~"), + new Pair<>(of(2024, 3, 1, 21, 15), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240301/2115/FN7huOUR4eLA-2EKxi9lTykJUFQNYc4LTHRHtyDlAgo~"), + new Pair<>(of(2024, 3, 2, 10, 0), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240302/1000/84ntwEOFY6aqexIEd9tXESW6qrl9aXk-x2l-LsHWvfk~"), + new Pair<>(of(2024, 3, 2, 13, 45), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240302/1345/9lxXFXQU6FHmyv1WpKX5ETpd24daZT16hNvXUJEUwik~"), + new Pair<>(of(2024, 3, 2, 17, 30), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240302/1730/ynmy2dsbgYygz2hPUS_vx-9YL13m2KZ0-9tw37XuBMQ~"), + new Pair<>(of(2024, 3, 2, 21, 15), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240302/2115/rH8i8BAFaaDjfNJBbZjj_7CV2dzOWcEOzyL618KYQVo~"), + new Pair<>(of(2024, 3, 3, 16, 30), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240303/1630/fU4VOzrp34B48KdsB1vpo2pi18sWSo2Tkknk03sO4HY~"), + new Pair<>(of(2024, 3, 3, 20, 15), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240303/2015/b1yBhvNosqm0nbWju1aCfb7LRBhRnMo_Y_h0VLZwmr0~"), + new Pair<>(of(2024, 3, 4, 12, 30), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240304/1230/DcGmb0KshRY0qv55Tuo4ydiJswd1H9wonrYGF1zGqQ0~"), + new Pair<>(of(2024, 3, 4, 16, 15), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240304/1615/BEd4wzePEH_Sxxuum4cXpsoOubN8fA6oecrWpwGJpcc~"), + new Pair<>(of(2024, 3, 4, 20, 0), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240304/2000/7Qldfc-0lDNALUw_lzuzM3KfarQWQAUi91qz2cMrNDk~"), + new Pair<>(of(2024, 3, 5, 12, 30), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240305/1230/QiP6Vvb9htMnFyTSUZRte1b_Ykw_n_yzaGpErBLFjOE~"), + new Pair<>(of(2024, 3, 5, 16, 15), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240305/1615/eY9ufKz1UM777apocN37PLvlsWwSJXc0xu7LMHecCbk~"), + new Pair<>(of(2024, 3, 5, 20, 0), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240305/2000/2gqVyU2_3NXv_fZiiAxV8Utom82nPW52kzVxzUDrMkI~"), + new Pair<>(of(2024, 3, 6, 16, 0), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240306/1600/Y8x2dIEq1QbEpZf7Td-6-3xqg-d4iDQU9p1fIjxJB0M~"), + new Pair<>(of(2024, 3, 6, 19, 45), "https://savoy.premiumkino.de/vorstellung/dune-part-two/20240306/1945/mSiOQk7DuM02IdmaVIvsv5nechCpRkWZwsK37hoXTyg~") + ), + movie("791 KM", + new Pair<>(of(2024, 3, 6, 11, 0), "https://savoy.premiumkino.de/vorstellung/791-km/20240306/1100/Mcvtz3tawhaIuyCtLtBkHwt6EI8b7oGXwh5OV4YWwNQ~") + ), + movie("Following", + new Pair<>(of(2024, 3, 9, 12, 0), "https://savoy.premiumkino.de/vorstellung/following/20240309/1200/-Aetrz3gC8l4rgVfGc98XXU7B87mTA4RCbWCgZuXHzc~") + ), + movie("Donnie Darko (Best of Cinema)", + new Pair<>(of(2024, 3, 16, 22, 15), "https://savoy.premiumkino.de/vorstellung/donnie-darko-best-of-cinema/20240316/2215/ZIBOwCyKuZ7A6OyYZWQ1AqF9O487dY_LAMmURYrGqUs~") + ), + movie("NT: Vanya", + new Pair<>(of(2024, 3, 18, 20, 30), "https://savoy.premiumkino.de/vorstellung/nt-vanya/20240318/2030/X9L2eAn_XElOtZRg7u4eiQ6kUCqcuJhrwQ5T76OAt2s~"), + new Pair<>(of(2024, 3, 23, 22, 15), "https://savoy.premiumkino.de/vorstellung/nt-vanya/20240323/2215/xXgXAH_I7xX3GsQ4eA4rZsOOrJqAtK0hCCXexFMj0Fk~"), + new Pair<>(of(2024, 4, 8, 20, 30), "https://savoy.premiumkino.de/vorstellung/nt-vanya/20240408/2030/PDQ-R_ltFWo8QAn-BbloxETvgegcTyaQyCZrG_MwQfo~") + ), + movie("No Country For Old Men", + new Pair<>(of(2024, 3, 26, 20, 15), "https://savoy.premiumkino.de/vorstellung/no-country-for-old-men/20240326/2015/jtZD6DfmChngY1mDGWlaaV8kZdUPL_QT2Fh-t0clBpU~") + ), + movie("Lisa Achatzi: Vom Traum zum Trauma - und zurück", + new Pair<>(of(2024, 4, 14, 12, 0), "https://savoy.premiumkino.de/vorstellung/lisa-achatzi-vom-traum-zum-trauma-und-zurueck/20240414/1200/MOLgymd988D7m8ZOvhM75aDc5suv3VO9aHobbLsaOgQ~") + ), + movie("Movie Quiz: Test Your Movie Knowledge", + new Pair<>(of(2024, 4, 15, 20, 15), "https://savoy.premiumkino.de/vorstellung/movie-quiz-test-your-movie-knowledge/20240415/2015/DMAaL86yGoobZhPTDdU2ksO9RUTFoPCiQKGOY7TO6tg~") + ) )); } - private Matcher movie(String name, LocalDateTime... presentationTimes) { + private Matcher movie(String name, Pair... presentationTimesAndLinks) { return new TypeSafeDiagnosingMatcher() { @Override protected boolean matchesSafely(Movie movie, Description mismatchDescription) { @@ -69,20 +156,20 @@ public class MovieExtractorTest { return false; } List ticketLinks = new ArrayList<>(movie.getTicketLinks()); - if (ticketLinks.size() != presentationTimes.length) { + if (ticketLinks.size() != presentationTimesAndLinks.length) { mismatchDescription.appendText("has ").appendValue(ticketLinks.size()).appendText(" presentations"); return false; } - for (LocalDateTime presentationTime : presentationTimes) { + for (Pair presentationTimeAndLink : presentationTimesAndLinks) { Optional foundTicketLink = empty(); for (TicketLink ticketLink : ticketLinks) { - if (ticketLink.getPresentationTime().equals(presentationTime)) { + if (ticketLink.getPresentationTime().equals(presentationTimeAndLink.getFirst()) && ticketLink.getLink().equals(presentationTimeAndLink.getSecond())) { foundTicketLink = Optional.of(ticketLink); break; } } if (!foundTicketLink.isPresent()) { - mismatchDescription.appendValue("has no presentation at ").appendValue(presentationTime); + mismatchDescription.appendValue("has no presentation at ").appendValue(presentationTimeAndLink.getFirst()); return false; } ticketLinks.remove(foundTicketLink.get()); @@ -97,7 +184,7 @@ public class MovieExtractorTest { @Override public void describeTo(Description description) { description.appendText("movie with name ").appendValue(name); - description.appendText(" and ").appendValue(presentationTimes.length).appendText(" presentations"); + description.appendText(" and ").appendValue(presentationTimesAndLinks.length).appendText(" presentations"); } }; } diff --git a/src/test/resources/net/pterodactylus/rhynodge/filters/webpages/savoy/savoy.html b/src/test/resources/net/pterodactylus/rhynodge/filters/webpages/savoy/savoy.html index 84dbe56..e2557f9 100644 --- a/src/test/resources/net/pterodactylus/rhynodge/filters/webpages/savoy/savoy.html +++ b/src/test/resources/net/pterodactylus/rhynodge/filters/webpages/savoy/savoy.html @@ -1,1552 +1,129 @@ - - - - - - - - - - -Filmprogramm - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- -
- -
- - - - - -
- - - - - -
- -
- - - - - - - - - - - -
- - - Foto: 22 Jump Street (OV) - - -   -

22 Jump Street (OV)

-

Action | Comedy | Crime - USA 2014
-FSK: 12 - 112 minutes
-
-Preview: July 30 at 8.15 pm
-Director: Phil Lord, Christopher Miller
-Stars: Jonah Hill, Channing Tatum, Ice Cube, Nick Offerman, Jack Maloney

-

ab 30.07.2014

- -
- - Video anschauen - - - - - - - -
-
- Detailansicht
-

Offizielle Webseite zum Film!

- - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Saal - - Heute - -
- 30.07.14
- - Do - -
- 31.07.14
- - Fr - -
- 01.08.14
- - Sa - -
- 02.08.14
- - So - -
- 03.08.14
- - Mo - -
- 04.08.14
- - Di - -
- 05.08.14
Saal
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
-
- Weitere Spielzeiten finden Sie in der Detailansicht. - - - - - - -
- - - - - -
- - - - - - - - - - - -
- - - Foto: How to Train Your Dragon 2 (3D/OV) - - -   -

How to Train Your Dragon 2 (3D/OV)

-

Animation | Action| Adventure - USA 2014
-FSK: 6 - 102 minutes
-
-Director: Dean DeBlois
-Stars: Cate Blanchett, Gerard Butler, Jonah Hill, Kristen Wiig, Craig Ferguson
-

-

ab 24.07.2014

- -
- - Video anschauen - - - - - - - -
-
- Detailansicht
-

Offzielle Webseite zum Film!

- - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Saal - - Heute - -
- 30.07.14
- - Do - -
- 31.07.14
- - Fr - -
- 01.08.14
- - Sa - -
- 02.08.14
- - So - -
- 03.08.14
- - Mo - -
- 04.08.14
- - Di - -
- 05.08.14
Saal
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
-
- Weitere Spielzeiten finden Sie in der Detailansicht. - - - - - - -
- - - - - -
- - - - - - - - - - - -
- - - Foto: Jersey Boys (OV) - - -   -

Jersey Boys (OV)

-

Biography | Drama | Musical - USA 2014
-FSK: 6 - 134 minutes
-
-Director: Clint Eastwood - Stars: Vincent Piazza, John Lloyd Young, Steve Schirripa, Christopher Walken, Kathrine Narducci

-

ab 31.07.2014

- -
- - Video anschauen - - - - - - - -
-
- Detailansicht
-

Offizielle Webseite zum Film!

- - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Saal - - Heute - -
- 30.07.14
- - Do - -
- 31.07.14
- - Fr - -
- 01.08.14
- - Sa - -
- 02.08.14
- - So - -
- 03.08.14
- - Mo - -
- 04.08.14
- - Di - -
- 05.08.14
Saal
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
-
- Weitere Spielzeiten finden Sie in der Detailansicht. - - - - - - -
- - - - - -
- - - - - - - - - - - -
- - - Foto: FILM CLUB presents: Ghostbusters (OV) - - -   -

FILM CLUB presents: Ghostbusters (OV)

-

Comedy | Fantasy | Sci-Fi - USA 1984
-FSK: 12 - 105 minutes
-
-Friday, August 1 at 7.30pm
-
-Director: Ivan Reitman - Stars: Bill Murray, Dan Aykroyd, Harold Ramis, Sigourney Weaver, Rick Moranis

-

01.08. bis 01.08.2014

- -
- - Video anschauen - - - - - - - -
-
- Detailansicht
- - - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Saal - - Heute - -
- 30.07.14
- - Do - -
- 31.07.14
- - Fr - -
- 01.08.14
- - Sa - -
- 02.08.14
- - So - -
- 03.08.14
- - Mo - -
- 04.08.14
- - Di - -
- 05.08.14
Saal
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
-
- Weitere Spielzeiten finden Sie in der Detailansicht. - - - - - - -
- - - - - -
- - - - - - - - - - - -
- - - Foto: Transformers: Age of Extinction (3D/OV) - - -   -

Transformers: Age of Extinction (3D/OV)

-

Action | Adventure | Sci-Fi - USA 2014
-FSK: 12 - 165 minutes
-
-Director: Michael Bay - Stars: Mark Wahlberg, Nicola Peltz, Ken Watanabe, T.J. Miller, Jack Reynor

-

ab 16.07.2014

- -
- - Video anschauen - - - - - - - -
-
- Detailansicht
-

Offizielle Webseite zum Film!

- - -
- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Saal - - Heute - -
- 30.07.14
- - Do - -
- 31.07.14
- - Fr - -
- 01.08.14
- - Sa - -
- 02.08.14
- - So - -
- 03.08.14
- - Mo - -
- 04.08.14
- - Di - -
- 05.08.14
Saal
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
-
-
- Weitere Spielzeiten finden Sie in der Detailansicht. - - - - - - -
- - - - - -
- - - - - - - - - - - -
- - - Foto: Dawn of the Planet of the Apes (3D/OV) - - -   -

Dawn of the Planet of the Apes (3D/OV)

-

Action | Drama | Sci-Fi - USA 2014
-FSK: 12 - 131 minutes
-
-Preview: August 6 at 8 pm
-Director: Matt Reeves
-Stars: Gary Oldman, Judy Greer, Keri Russell, Andy Serkis, Jimmy Sweetwater

-

ab 06.08.2014

- -
- - Video anschauen - - - - - - - -
-
- Detailansicht
-

Offizielle Webseite zum Film!

- - -
- - - - - -
- Innerhalb der nächsten 7 Tage keine Spielzeit. Weitere Spielzeiten finden Sie in der Detailansicht. - - - - - - - - -
- - - - - -
- - - - - - - - - - - -
- - - Foto: Traumkino: Yves Saint Laurent (Deutsche Fassung) - - -   -

Traumkino: Yves Saint Laurent (Deutsche Fassung)

-

Drama | Biographie - FR 2014
-FSK: 12 - 106 Minuten
-
-Regie: Jalil Lespert - Darsteller: Pierre Niney, Guillaume Gallienne, Charlotte Le Bon, Laura Smet, Marie de Villepin
-
-An jedem 1. und 3. Mittwoch im Monat jeweils um 11 Uhr gibt es für nur 5,- Euro einen ausgewählten Film in der deutschen Sprachfassung.

-

06.08. bis 06.08.2014

- -
- - Video anschauen - - - - - - - -
-
- Detailansicht
-

Offizielle Webseite zum Film!

- - -
- - - - - -
- Innerhalb der nächsten 7 Tage keine Spielzeit. Weitere Spielzeiten finden Sie in der Detailansicht. - - - - - - - - -
- - - - - -
- - - - - - - - - - - -
- - - Foto: Hector and the Search for Happiness (OV) - - -   -

Hector and the Search for Happiness (OV)

-

Adventure | Comedy | Drama - DE/CA 2014
-FSK: 12 - 120 minutes
-
-Preview: August 10 at 8 pm
-Director: Peter Chelsom - Stars: Simon Pegg, Rosamund Pike, Toni Collette, Stellan Skarsgård, Christopher Plummer

-

ab 10.08.2014

- -
- - Video anschauen - - - - - - - -
-
- Detailansicht
-

Offizielle Webseite zum Film!

- - -
- - - - - -
- Innerhalb der nächsten 7 Tage keine Spielzeit. Weitere Spielzeiten finden Sie in der Detailansicht. - - - - - - - - -
- - - - - -
- - - - - - - - - - - -
- - - Foto: The Expendables 3 (OV) - - -   -

The Expendables 3 (OV)

-

Action | Adventure | Thriller - USA 2014
-FSK: ? - 103 minutes
-
-Preview: August 20 at 8.15 pm
-Director: Patrick Hughes
-Stars: Sylvester Stallone, Jason Statham, Mel Gibson, Harrison Ford, Arnold Schwarzenegger

-

ab 20.08.2014

- -
- - Video anschauen - - - - - - - -
-
- Detailansicht
-

Offizielle Webseite zum Film!

- - -
- - - - - -
- Innerhalb der nächsten 7 Tage keine Spielzeit. Weitere Spielzeiten finden Sie in der Detailansicht. - - - - - - - - -
- - - - - -
- - - - - - - - - - - -
- - - Foto: Doctor Who: Deep Breath - - -   -

Doctor Who: Deep Breath

-

Doctor Who makes a spectacular return to the big screen in the feature-length premiere episode of Series 8; Deep Breath.
-
-August 23 at 8.30 pm

-

23.08. bis 23.08.2014

- -
- - Video anschauen - - - - - - - -
-
- Detailansicht
-

Doctor Who

- - -
- - - - - -
- Innerhalb der nächsten 7 Tage keine Spielzeit. Weitere Spielzeiten finden Sie in der Detailansicht. - - - - - - - - -
- - - - - -
- - - - - - - - - - - -
- - - Foto: Traumkino: Boyhood (Deutsche Sprachfassung) - - -   -

Traumkino: Boyhood (Deutsche Sprachfassung)

-

Drama - USA 2014
-FSK: 6 - 166 Minuten
-
-Regie: Richard Linklater - Darsteller: Ellar Coltrane, Patricia Arquette, Ethan Hawke, Lorelei Linklater, Libby Villari
-
-An jedem 1. und 3. Mittwoch im Monat jeweils um 11 Uhr gibt es für nur 5,- Euro einen ausgewählten Film in der deutschen Sprachfassung.

-

20.08. bis 20.08.2014

- -
- - Video anschauen - - - - - - - -
-
- Detailansicht
-

Offizielle Webseite zum Film!

- - -
- - - - - -
- Innerhalb der nächsten 7 Tage keine Spielzeit. Weitere Spielzeiten finden Sie in der Detailansicht. - - - - - - - - -
- - - - - -
- - -
- - - - - -
- -
-
- -
- - - - - - \ No newline at end of file + + + SAVOY Filmtheater Hamburg + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
00 Artikel

Wochenprogramm

Hier sehen Sie unser Programm, nach Kinowochen gruppiert.

+

Aktuelle Kinowoche

Heute

All of Us Strangers

All of Us Strangers

Dune

Dune

SAVOY Sneak-Preview

SAVOY Sneak-Preview

Sa. 10.02.

All of Us Strangers

All of Us Strangers

Dune

Dune

Der Junge und der Reiher

Der Junge und der Reiher

Poor Things

Poor Things

So. 11.02.

All of Us Strangers

All of Us Strangers

Dune

Dune

Poor Things

Poor Things

Mo. 12.02.

All of Us Strangers

All of Us Strangers

Dune

Dune

Di. 13.02.

All of Us Strangers

All of Us Strangers

Dune

Dune

Poor Things

Poor Things

Mi. 14.02.

Do. 15.02. - Mi. 21.02.

Do. 22.02. - Mi. 28.02.

Do. 29.02. - Mi. 06.03.

Sa. 09.03.

Sa. 16.03. - Mo. 18.03.

Sa. 23.03. - Di. 26.03.

Mo. 08.04.

So. 14.04. - Mo. 15.04.

0 Plätze gewählt
0 Plätze gewählt
00 Artikel

Ihre PayPal-Zahlung wird ausgeführt.

Ihre Zahlung wird bearbeitet.

Zahlung wird vorbereitet.

Ihre Zahlung mit Google Pay wird ausgeführt.

Ihre Zahlung mit Google Pay wird vorbereitet.

Ihre Zahlung mit Apple Pay wird ausgeführt.

Ihre Zahlung mit Apple Pay wird vorbereitet.

Ihre Gutschein-Zahlung wird ausgeführt.

Ihre kostenfreie Bestellung wird ausgeführt.

Ihre Kundenkarten-Zahlung wird ausgeführt.

+ + + + + \ No newline at end of file -- 2.7.4