storespotlighttype; spotlight implementation start

This commit is contained in:
2015-05-03 23:00:28 +02:00
parent 689bdfa566
commit 44de291149
2 changed files with 37 additions and 0 deletions
+25
View File
@@ -81,6 +81,31 @@ namespace OnePeek.Api
}
/// <summary>
/// Get spotlight entries for the current day in the specified culture
/// </summary>
/// <param name="spotlightType">Can either be apps or games. Both return approx. 20 new results per day.</param>
/// <param name="store">The store where the app is published.</param>
/// <param name="storeCulture">Culture of the query (returns location specific metadata + ratings).</param>
/// <returns></returns>
public async Task<StoreSearchResults> 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<XElement> xel = XDocument.Parse(xml).Elements().First().Descendants();
StoreSearchResults result = new StoreSearchResults();
return result;
}
/// <summary>
/// Get app description, images, publisher, rating and more for an app in the specified culture.
/// </summary>
@@ -0,0 +1,12 @@
using System.ComponentModel.DataAnnotations;
namespace OnePeek.Entities
{
public enum StoreSpotlightType
{
[Display(Name = "apps")]
Apps,
[Display(Name = "games")]
Games
}
}