public OpenWeatherMapRestClient(IOpenWeatherMapSettings openWeatherMapSettings)
        {
            _client = new RestClient(openWeatherMapSettings.OpenWeatherMapBaseUrl);

            _request = new RestRequest("weather?id={id}&appid={appid}", Method.GET);
            _request
            .AddUrlSegment("id", openWeatherMapSettings.OpenWeatherMapCityID)
            .AddUrlSegment("appid", openWeatherMapSettings.OpenWeatherMapAPIKey);
        }
        public OpenWeatherMapCrawler(
            IOpenWeatherMapSettings openWeatherMapSettings,
            IOpenWeatherMapRestClient openWeatherMapRestClient,
            IWeatherMapper weatherMapper,
            WeatherContext weatherContext)
        {
            _openWeatherMapCityID     = openWeatherMapSettings.OpenWeatherMapCityID;
            _openWeatherMapAPIKey     = openWeatherMapSettings.OpenWeatherMapAPIKey;
            _openWeatherMapTimeSpan   = openWeatherMapSettings.OpenWeatherMapTimeSpan;
            _openWeatherMapRestClient = openWeatherMapRestClient;
            _weatherMapper            = weatherMapper;
            _weatherContext           = weatherContext;


            WeatherSource = Observable.Interval(_openWeatherMapTimeSpan)
                            .Select(x => Work());
        }
Exemple #3
0
 public OpenWeatherMapClient(IOpenWeatherMapSettings settings)
 {
     _settings = settings;
 }