예제 #1
0
        private IEnumerable <Profile> FindAllProfilesForLocation(string locationText)
        {
            var contentToString = _inquisitor.GetLocationSearchResults(locationText);

            var json  = JObject.Parse(contentToString);
            var token = json["items"];

            if (token != null)
            {
                var array = JArray.Parse(token.ToString());

                for (var index = 0; index < array.Count; index++)
                {
                    var profileUrl       = array[index].KeyToString("url");
                    var profileRawResult = _inquisitor.GetVerbatimSearchResults(profileUrl);
                    var profileJson      = JObject.Parse(profileRawResult);
                    var profile          = MakeProfileFromJson(profileJson);

                    yield return(profile);
                }
            }
        }