private IEnumerable <PlaceInfo> GetBarData(string latitude, string longitude) { var categories = _categoryListString.Split(','); var placeList = new List <PlaceInfo>(); foreach (var category in categories) { var link = string.Format(_mapperLink, latitude, longitude, _accessKey, category); var jsonStream = _fetcher.GetHttpStream(link); placeList.AddRange(JsonConvert.DeserializeObject <PlacesResponse>(jsonStream).data); } FetchLocations(placeList); return(placeList); }
public static T FetchAndDeserialize <T>(string link, IHttpFetcher fetcher) { var jsonStream = fetcher.GetHttpStream(link); var deserialized = JsonConvert.DeserializeObject <T>(jsonStream); return(deserialized); }
private IEnumerable <Place> GetBarData(string latitude, string longitude, string radius) { var link = string.Format(_apiLink, _accessToken, latitude, longitude, radius, _requestedFields, _category); var jsonStream = _fetcher.GetHttpStream(link); var barList = JsonConvert.DeserializeObject <PlacesResponse>(jsonStream).data; return(barList); }
private IEnumerable <Venue> GetBarData(string latitude, string longitude, string radius) { var categoryIDs = _categoryIdDs.Split(','); var venueList = new List <Venue>(); foreach (var category in categoryIDs) { var link = string.Format(_apiLink, _clientId, _clientSecret, latitude, longitude, category, radius); var jsonStream = _fetcher.GetHttpStream(link); venueList.AddRange(JsonConvert.DeserializeObject <SearchResponse>(jsonStream).response.venues); } return(venueList); }
private IEnumerable <Place> GetBarData(string latitude, string longitude, string radius) { var categoryList = _categoryList.Split(','); var placeList = new List <Place>(); foreach (var category in categoryList) { var link = string.Format(_apiLink, latitude, longitude, radius, category, _apiKey); var jsonStream = _fetcher.GetHttpStream(link); var deserialized = JsonConvert.DeserializeObject <PlacesApiQueryResponse>(jsonStream).Results; placeList.AddRange(deserialized); } return(placeList); }