diff --git a/src/OnePeek.Api/OnePeekApi.cs b/src/OnePeek.Api/OnePeekApi.cs index 86d98e0..c64a112 100644 --- a/src/OnePeek.Api/OnePeekApi.cs +++ b/src/OnePeek.Api/OnePeekApi.cs @@ -81,6 +81,31 @@ namespace OnePeek.Api } + /// + /// Get spotlight entries for the current day in the specified culture + /// + /// Can either be apps or games. Both return approx. 20 new results per day. + /// The store where the app is published. + /// Culture of the query (returns location specific metadata + ratings). + /// + public async Task GetSpotlight(StoreSpotlightType spotlightType, StoreType store, StoreCultureType storeCulture) + { + if (storeCulture == StoreCultureType.Unknown || storeCulture == StoreCultureType.All) + { + throw new ArgumentException("Please provide a valid store culture"); + } + + Uri uri = EndpointUris.GetWindowsPhoneSpotlightUri(storeCulture.ToString(), spotlightType.GetEnumDisplayName()); + + string xml = await ApiHttpClient.Instance.Get(uri); + + IEnumerable xel = XDocument.Parse(xml).Elements().First().Descendants(); + + StoreSearchResults result = new StoreSearchResults(); + return result; + } + + /// /// Get app description, images, publisher, rating and more for an app in the specified culture. /// diff --git a/src/OnePeek.Entities/StoreSpotlightType.cs b/src/OnePeek.Entities/StoreSpotlightType.cs new file mode 100644 index 0000000..7dc3610 --- /dev/null +++ b/src/OnePeek.Entities/StoreSpotlightType.cs @@ -0,0 +1,12 @@ +using System.ComponentModel.DataAnnotations; + +namespace OnePeek.Entities +{ + public enum StoreSpotlightType + { + [Display(Name = "apps")] + Apps, + [Display(Name = "games")] + Games + } +}