diff --git a/src/OnePeek.Api/ApiHttpClient.cs b/src/OnePeek.Api/ApiHttpClient.cs index 727008a..c2e0dd9 100644 --- a/src/OnePeek.Api/ApiHttpClient.cs +++ b/src/OnePeek.Api/ApiHttpClient.cs @@ -29,6 +29,7 @@ namespace OnePeek.Api { AutomaticDecompression = DecompressionMethods.Deflate | DecompressionMethods.GZip }); + httpClient.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2327.5 Safari/537.36 OPR/30.0.1812.0 (Edition developer)"); } diff --git a/src/OnePeek.Api/EndpointUris.cs b/src/OnePeek.Api/EndpointUris.cs index 56b7dc8..585f32a 100644 --- a/src/OnePeek.Api/EndpointUris.cs +++ b/src/OnePeek.Api/EndpointUris.cs @@ -8,15 +8,31 @@ namespace OnePeek.Api { internal static class EndpointUris { - private const string WINDOWSPHONE_METADATA_URI = "http://marketplaceedgeservice.windowsphone.com/v9/catalog/apps/{0}?os=8.10.14219.0&cc={1}&lang={2}"; + public const string WINDOWSPHONE_IMAGE_URI = "http://cdn.marketplaceimages.windowsphone.com/v8/images/{0}?imageType=ws_icon_large"; + + public const string WINDOWSPHONE_METADATA_URI = "http://marketplaceedgeservice.windowsphone.com/v9/catalog/apps/{0}?os=8.10.14219.0&cc={1}&lang={2}"; + internal static Uri GetWindowsPhoneMetadataUri(string appId, string culture) { culture = culture.Replace('_', '-'); string country = culture.Split('-')[1]; - string uriString = String.Format(WINDOWSPHONE_METADATA_URI, appId, country, culture); + return Uri(WINDOWSPHONE_METADATA_URI, appId, country, culture); + } + + + internal static Uri GetWindowsPhoneImageUri(string urn) + { + return Uri(WINDOWSPHONE_IMAGE_URI, urn.Replace("urn:uuid:", "")); + } + + + + private static Uri Uri(string template, params string[] replacements) + { + string uriString = String.Format(template, replacements).ToLower(); return new Uri(uriString, UriKind.Absolute); } } diff --git a/src/OnePeek.Api/OnePeek.Api.csproj b/src/OnePeek.Api/OnePeek.Api.csproj index f3206a1..4dc861c 100644 --- a/src/OnePeek.Api/OnePeek.Api.csproj +++ b/src/OnePeek.Api/OnePeek.Api.csproj @@ -44,6 +44,7 @@ + @@ -53,6 +54,12 @@ + + ..\packages\Bender.3.0.4.0\lib\Bender.dll + + + ..\packages\flexo.1.0.0.18\lib\Flexo.dll + ..\packages\Microsoft.Bcl.Async.1.0.168\lib\portable-net45+win8+wpa81\Microsoft.Threading.Tasks.dll diff --git a/src/OnePeek.sln b/src/OnePeek.sln index e6d3e4f..40b85f1 100644 --- a/src/OnePeek.sln +++ b/src/OnePeek.sln @@ -6,6 +6,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OnePeek.Api", "OnePeek.Api\ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OnePeek.Entities", "OnePeek.Entities\OnePeek.Entities.csproj", "{D45D6378-3ED0-4445-94FE-21F62C1DF4E6}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OnePeek.Console", "OnePeek.Console\OnePeek.Console.csproj", "{A68611D8-A796-4A7A-A69D-D61B929CF8D8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -20,6 +22,10 @@ Global {D45D6378-3ED0-4445-94FE-21F62C1DF4E6}.Debug|Any CPU.Build.0 = Debug|Any CPU {D45D6378-3ED0-4445-94FE-21F62C1DF4E6}.Release|Any CPU.ActiveCfg = Release|Any CPU {D45D6378-3ED0-4445-94FE-21F62C1DF4E6}.Release|Any CPU.Build.0 = Release|Any CPU + {A68611D8-A796-4A7A-A69D-D61B929CF8D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A68611D8-A796-4A7A-A69D-D61B929CF8D8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A68611D8-A796-4A7A-A69D-D61B929CF8D8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A68611D8-A796-4A7A-A69D-D61B929CF8D8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE