Exact picture seems to work
This commit is contained in:
@@ -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 {
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user