Exact picture seems to work

This commit is contained in:
2025-09-02 21:53:03 +02:00
parent f15208fe6d
commit b2571c191f
137 changed files with 2487 additions and 797 deletions

View File

@@ -0,0 +1,16 @@
package ch.gtache.fro.modules.vogelwarte;
import jakarta.inject.Qualifier;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Qualifier for the Vogelwarte fetcher
*/
@Qualifier
@Documented
@Retention(RetentionPolicy.RUNTIME)
public @interface Vogelwarte {
}

View File

@@ -1,15 +1,33 @@
package ch.gtache.fro.modules.vogelwarte;
import ch.gtache.fro.Fetcher;
import ch.gtache.fro.FetcherConfiguration;
import ch.gtache.fro.impl.FetcherConfigurationImpl;
import ch.gtache.fro.vogelwarte.VogelwarteFetcher;
import dagger.Binds;
import dagger.Module;
import dagger.Provides;
import dagger.multibindings.IntoSet;
import jakarta.inject.Singleton;
/**
* Dagger module for the vogelwarte.ch fetcher
*/
@Module
public abstract class VogelwarteModule {
private VogelwarteModule() {
//Empty constructor
}
@Binds
@IntoSet
abstract Fetcher bindsFetcher(VogelwarteFetcher fetcher);
@Provides
@Vogelwarte
@Singleton
static FetcherConfiguration providesFetcherConfiguration() {
return new FetcherConfigurationImpl("Vogelwarte");
}
}

View File

@@ -2,11 +2,12 @@ package ch.gtache.fro.vogelwarte;
import ch.gtache.fro.Bird;
import ch.gtache.fro.BirdProvider;
import ch.gtache.fro.Configuration;
import ch.gtache.fro.FetchException;
import ch.gtache.fro.Fetcher;
import ch.gtache.fro.FetcherConfiguration;
import ch.gtache.fro.PictureType;
import ch.gtache.fro.SoundType;
import ch.gtache.fro.modules.vogelwarte.Vogelwarte;
import ch.gtache.fro.selenium.AbstractSeleniumFetcher;
import jakarta.inject.Inject;
import jakarta.inject.Singleton;
@@ -35,7 +36,7 @@ public class VogelwarteFetcher extends AbstractSeleniumFetcher {
private static final Pattern IMAGE_PATTERN = Pattern.compile("https://www\\.vogelwarte\\.ch/wp-content/(?:assets/images/bird/species|uploads/\\d{4}/\\d{2})/(?<id>\\d+(?:_\\d+)?)\\.jpg");
@Inject
VogelwarteFetcher(final BirdProvider birdProvider, final Configuration configuration) {
VogelwarteFetcher(final BirdProvider birdProvider, @Vogelwarte final FetcherConfiguration configuration) {
super(birdProvider, configuration);
}

View File

@@ -3,12 +3,14 @@
*/
module ch.gtache.fro.vogelwarte {
requires transitive ch.gtache.fro.selenium;
requires org.jsoup;
requires transitive jakarta.inject;
requires transitive java.compiler;
requires java.net.http;
requires jakarta.inject;
requires org.apache.logging.log4j;
requires dagger;
requires java.compiler;
requires org.seleniumhq.selenium.api;
requires ch.gtache.fro.api;
requires ch.gtache.fro.core;
exports ch.gtache.fro.vogelwarte;
exports ch.gtache.fro.modules.vogelwarte;
}