Search in sources :

Example 1 with RMPScraper

use of com.tevinjeffrey.rmp.scraper.RMPScraper in project Rutgers-Course-Tracker by tevjef.

the class ScraperModule method providesRMP.

@Provides
@Singleton
public RMPScraper providesRMP(OkHttpClient client) {
    OkHttpClient okClient = client.clone();
    okClient.setConnectTimeout(CONNECT_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);
    okClient.setReadTimeout(READ_TIMEOUT_MILLIS, TimeUnit.MILLISECONDS);
    //okClient.networkInterceptors().add(getCacheControlInterceptor(TimeUnit.DAYS.toMillis(7)));
    return new RMPScraper(okClient);
}
Also used : OkHttpClient(com.squareup.okhttp.OkHttpClient) RMPScraper(com.tevinjeffrey.rmp.scraper.RMPScraper) Singleton(javax.inject.Singleton) Provides(dagger.Provides)

Aggregations

OkHttpClient (com.squareup.okhttp.OkHttpClient)1 RMPScraper (com.tevinjeffrey.rmp.scraper.RMPScraper)1 Provides (dagger.Provides)1 Singleton (javax.inject.Singleton)1