From d2af8b18644ee4a57e639146acd2fb5330efebe6 Mon Sep 17 00:00:00 2001 From: mmuffins Date: Tue, 22 May 2018 22:45:33 +0200 Subject: [PATCH] Initial implementation for appdetails method. --- SteamStorefrontAPI.sln | 6 + SteamStorefrontAPI/Class1.cs | 12 -- SteamStorefrontAPI/SteamStorefrontAPI.csproj | 51 +++++--- SteamStorefrontAPI/appdetails/AppDetails.cs | 45 +++++++ .../appdetails/Classes/Achievements.cs | 20 +++ .../appdetails/Classes/Category.cs | 20 +++ .../appdetails/Classes/Genre.cs | 21 ++++ .../appdetails/Classes/Highlighted.cs | 20 +++ .../appdetails/Classes/Movie.cs | 30 +++++ .../appdetails/Classes/PackageGroup.cs | 39 ++++++ .../appdetails/Classes/PcRequirements.cs | 20 +++ .../appdetails/Classes/Platforms.cs | 24 ++++ .../appdetails/Classes/PriceOverview.cs | 64 ++++++++++ .../appdetails/Classes/Recommendations.cs | 17 +++ .../appdetails/Classes/ReleaseDate.cs | 20 +++ .../appdetails/Classes/Screenshot.cs | 24 ++++ .../appdetails/Classes/SteamApp.cs | 119 ++++++++++++++++++ SteamStorefrontAPI/appdetails/Classes/Sub.cs | 39 ++++++ .../appdetails/Classes/SupportInfo.cs | 20 +++ SteamStorefrontAPI/packages.config | 4 + SteamStorefrontConsole/App.config | 6 + SteamStorefrontConsole/Program.cs | 32 +++++ .../Properties/AssemblyInfo.cs | 36 ++++++ .../SteamStorefrontConsole.csproj | 58 +++++++++ 24 files changed, 717 insertions(+), 30 deletions(-) delete mode 100644 SteamStorefrontAPI/Class1.cs create mode 100644 SteamStorefrontAPI/appdetails/AppDetails.cs create mode 100644 SteamStorefrontAPI/appdetails/Classes/Achievements.cs create mode 100644 SteamStorefrontAPI/appdetails/Classes/Category.cs create mode 100644 SteamStorefrontAPI/appdetails/Classes/Genre.cs create mode 100644 SteamStorefrontAPI/appdetails/Classes/Highlighted.cs create mode 100644 SteamStorefrontAPI/appdetails/Classes/Movie.cs create mode 100644 SteamStorefrontAPI/appdetails/Classes/PackageGroup.cs create mode 100644 SteamStorefrontAPI/appdetails/Classes/PcRequirements.cs create mode 100644 SteamStorefrontAPI/appdetails/Classes/Platforms.cs create mode 100644 SteamStorefrontAPI/appdetails/Classes/PriceOverview.cs create mode 100644 SteamStorefrontAPI/appdetails/Classes/Recommendations.cs create mode 100644 SteamStorefrontAPI/appdetails/Classes/ReleaseDate.cs create mode 100644 SteamStorefrontAPI/appdetails/Classes/Screenshot.cs create mode 100644 SteamStorefrontAPI/appdetails/Classes/SteamApp.cs create mode 100644 SteamStorefrontAPI/appdetails/Classes/Sub.cs create mode 100644 SteamStorefrontAPI/appdetails/Classes/SupportInfo.cs create mode 100644 SteamStorefrontAPI/packages.config create mode 100644 SteamStorefrontConsole/App.config create mode 100644 SteamStorefrontConsole/Program.cs create mode 100644 SteamStorefrontConsole/Properties/AssemblyInfo.cs create mode 100644 SteamStorefrontConsole/SteamStorefrontConsole.csproj diff --git a/SteamStorefrontAPI.sln b/SteamStorefrontAPI.sln index 66de459..65c63d2 100644 --- a/SteamStorefrontAPI.sln +++ b/SteamStorefrontAPI.sln @@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.27428.2043 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SteamStorefrontAPI", "SteamStorefrontAPI\SteamStorefrontAPI.csproj", "{76131ABE-46BD-4A82-B5E6-F29A47F2F64D}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SteamStorefrontConsole", "SteamStorefrontConsole\SteamStorefrontConsole.csproj", "{44AAB32B-8986-48E0-8A08-42CE967D01F4}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -15,6 +17,10 @@ Global {76131ABE-46BD-4A82-B5E6-F29A47F2F64D}.Debug|Any CPU.Build.0 = Debug|Any CPU {76131ABE-46BD-4A82-B5E6-F29A47F2F64D}.Release|Any CPU.ActiveCfg = Release|Any CPU {76131ABE-46BD-4A82-B5E6-F29A47F2F64D}.Release|Any CPU.Build.0 = Release|Any CPU + {44AAB32B-8986-48E0-8A08-42CE967D01F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {44AAB32B-8986-48E0-8A08-42CE967D01F4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {44AAB32B-8986-48E0-8A08-42CE967D01F4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {44AAB32B-8986-48E0-8A08-42CE967D01F4}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SteamStorefrontAPI/Class1.cs b/SteamStorefrontAPI/Class1.cs deleted file mode 100644 index 8c25c7b..0000000 --- a/SteamStorefrontAPI/Class1.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SteamStorefrontAPI -{ - public class Class1 - { - } -} diff --git a/SteamStorefrontAPI/SteamStorefrontAPI.csproj b/SteamStorefrontAPI/SteamStorefrontAPI.csproj index 6fe6bea..ecbaa97 100644 --- a/SteamStorefrontAPI/SteamStorefrontAPI.csproj +++ b/SteamStorefrontAPI/SteamStorefrontAPI.csproj @@ -1,10 +1,10 @@ - + Debug AnyCPU - 76131abe-46bd-4a82-b5e6-f29a47f2f64d + {76131ABE-46BD-4A82-B5E6-F29A47F2F64D} Library Properties SteamStorefrontAPI @@ -30,24 +30,39 @@ 4 - - - - - - - - - - - - - - + + ..\packages\Newtonsoft.Json.11.0.2\lib\net45\Newtonsoft.Json.dll + + + + + + + + + - + + + + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/SteamStorefrontAPI/appdetails/AppDetails.cs b/SteamStorefrontAPI/appdetails/AppDetails.cs new file mode 100644 index 0000000..d686d98 --- /dev/null +++ b/SteamStorefrontAPI/appdetails/AppDetails.cs @@ -0,0 +1,45 @@ +using Newtonsoft.Json.Linq; +using SteamStorefrontAPI.Classes; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; + +namespace SteamStorefrontAPI +{ + public static class AppDetails + { + private static HttpClient client = new HttpClient(); + private const string steamBaseUri = "http://store.steampowered.com/api/appdetails"; + + public static async Task GetAsync(int AppId) + { + return await GetAsync(AppId, null, null); + } + + public static async Task GetAsync(int AppId, string CountryCode) + { + return await GetAsync(AppId, CountryCode, null); + } + + public static async Task GetAsync(int AppId, string CountryCode, string Language) + { + string steamUri = $"{steamBaseUri}?appids={AppId}"; + steamUri = CountryCode is null ? steamUri : $"{steamUri}&cc={CountryCode}"; + steamUri = Language is null ? steamUri : $"{steamUri}&l={Language}"; + + var response = await client.GetAsync(steamUri); + if (!response.IsSuccessStatusCode) { return null; } + + var result = await response.Content.ReadAsStringAsync(); + + // The actual payload is wrapped, drill down to the third level to get to it + var jsonData = JToken.Parse(result).First.First; + if (!bool.Parse(jsonData["success"].ToString())) { return null; } + + return jsonData["data"].ToObject(); + } + } +} diff --git a/SteamStorefrontAPI/appdetails/Classes/Achievements.cs b/SteamStorefrontAPI/appdetails/Classes/Achievements.cs new file mode 100644 index 0000000..ba513c8 --- /dev/null +++ b/SteamStorefrontAPI/appdetails/Classes/Achievements.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Globalization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace SteamStorefrontAPI +{ + public class Achievements + { + [JsonProperty("total")] + public long Total { get; set; } + + [JsonProperty("highlighted")] + public List Highlighted { get; set; } + } +} diff --git a/SteamStorefrontAPI/appdetails/Classes/Category.cs b/SteamStorefrontAPI/appdetails/Classes/Category.cs new file mode 100644 index 0000000..0c8e4cf --- /dev/null +++ b/SteamStorefrontAPI/appdetails/Classes/Category.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Globalization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace SteamStorefrontAPI +{ + public class Category + { + [JsonProperty("id")] + public long Id { get; set; } + + [JsonProperty("description")] + public string Description { get; set; } + } +} diff --git a/SteamStorefrontAPI/appdetails/Classes/Genre.cs b/SteamStorefrontAPI/appdetails/Classes/Genre.cs new file mode 100644 index 0000000..96685b4 --- /dev/null +++ b/SteamStorefrontAPI/appdetails/Classes/Genre.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Globalization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace SteamStorefrontAPI +{ + public class Genre + { + [JsonProperty("id")] + public string Id { get; set; } + + [JsonProperty("description")] + public string Description { get; set; } + } + +} diff --git a/SteamStorefrontAPI/appdetails/Classes/Highlighted.cs b/SteamStorefrontAPI/appdetails/Classes/Highlighted.cs new file mode 100644 index 0000000..2a4f271 --- /dev/null +++ b/SteamStorefrontAPI/appdetails/Classes/Highlighted.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Globalization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace SteamStorefrontAPI +{ + public class Highlighted + { + [JsonProperty("name")] + public string Name { get; set; } + + [JsonProperty("path")] + public string Path { get; set; } + } +} diff --git a/SteamStorefrontAPI/appdetails/Classes/Movie.cs b/SteamStorefrontAPI/appdetails/Classes/Movie.cs new file mode 100644 index 0000000..2e9f984 --- /dev/null +++ b/SteamStorefrontAPI/appdetails/Classes/Movie.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Globalization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace SteamStorefrontAPI +{ + public class Movie + { + [JsonProperty("id")] + public long Id { get; set; } + + [JsonProperty("name")] + public string Name { get; set; } + + [JsonProperty("thumbnail")] + public string Thumbnail { get; set; } + + [JsonProperty("webm")] + public Dictionary Webm { get; set; } + + [JsonProperty("highlight")] + public bool Highlight { get; set; } + } + +} diff --git a/SteamStorefrontAPI/appdetails/Classes/PackageGroup.cs b/SteamStorefrontAPI/appdetails/Classes/PackageGroup.cs new file mode 100644 index 0000000..620184b --- /dev/null +++ b/SteamStorefrontAPI/appdetails/Classes/PackageGroup.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Globalization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace SteamStorefrontAPI +{ + + public class PackageGroup + { + [JsonProperty("name")] + public string Name { get; set; } + + [JsonProperty("title")] + public string Title { get; set; } + + [JsonProperty("description")] + public string Description { get; set; } + + [JsonProperty("selection_text")] + public string SelectionText { get; set; } + + [JsonProperty("save_text")] + public string SaveText { get; set; } + + [JsonProperty("display_type")] + public long DisplayType { get; set; } + + [JsonProperty("is_recurring_subscription")] + public string IsRecurringSubscription { get; set; } + + [JsonProperty("subs")] + public List Subs { get; set; } + } +} diff --git a/SteamStorefrontAPI/appdetails/Classes/PcRequirements.cs b/SteamStorefrontAPI/appdetails/Classes/PcRequirements.cs new file mode 100644 index 0000000..bc72d5f --- /dev/null +++ b/SteamStorefrontAPI/appdetails/Classes/PcRequirements.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Globalization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace SteamStorefrontAPI +{ + public class PcRequirements + { + [JsonProperty("minimum")] + public string Minimum { get; set; } + + [JsonProperty("recommended")] + public string Recommended { get; set; } + } +} diff --git a/SteamStorefrontAPI/appdetails/Classes/Platforms.cs b/SteamStorefrontAPI/appdetails/Classes/Platforms.cs new file mode 100644 index 0000000..6689c58 --- /dev/null +++ b/SteamStorefrontAPI/appdetails/Classes/Platforms.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Globalization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace SteamStorefrontAPI +{ + public class Platforms + { + [JsonProperty("windows")] + public bool Windows { get; set; } + + [JsonProperty("mac")] + public bool Mac { get; set; } + + [JsonProperty("linux")] + public bool Linux { get; set; } + } + +} diff --git a/SteamStorefrontAPI/appdetails/Classes/PriceOverview.cs b/SteamStorefrontAPI/appdetails/Classes/PriceOverview.cs new file mode 100644 index 0000000..85704cf --- /dev/null +++ b/SteamStorefrontAPI/appdetails/Classes/PriceOverview.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Globalization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace SteamStorefrontAPI +{ + public class PriceOverview + { + [JsonProperty("currency")] + public string Currency { get; set; } + + [JsonProperty("initial")] + [JsonConverter(typeof(LongToDoubleConverter))] + public double Initial { get; set; } + + [JsonProperty("final")] + [JsonConverter(typeof(LongToDoubleConverter))] + public double Final { get; set; } + + [JsonProperty("discount_percent")] + public long DiscountPercent { get; set; } + } + + public class LongToDoubleConverter : JsonConverter + { + public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer) + { + long longValue = long.Parse(reader.Value.ToString()); + double convertedValue = longValue / 100.0; + return convertedValue; + } + + public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) + { + throw new NotImplementedException("Unnecessary because CanRead is CanWrite. The type will skip the converter."); + } + + public override bool CanConvert(Type objectType) + { + throw new NotImplementedException(); + } + + public override bool CanRead + { + get { return true; } + } + + public override bool CanWrite + { + get { return false; } + } + } + + public class PriceOverviewSerializer : JsonSerializer + { + + } + +} diff --git a/SteamStorefrontAPI/appdetails/Classes/Recommendations.cs b/SteamStorefrontAPI/appdetails/Classes/Recommendations.cs new file mode 100644 index 0000000..4296728 --- /dev/null +++ b/SteamStorefrontAPI/appdetails/Classes/Recommendations.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Globalization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace SteamStorefrontAPI +{ + public class Recommendations + { + [JsonProperty("total")] + public long Total { get; set; } + } +} diff --git a/SteamStorefrontAPI/appdetails/Classes/ReleaseDate.cs b/SteamStorefrontAPI/appdetails/Classes/ReleaseDate.cs new file mode 100644 index 0000000..7e32d17 --- /dev/null +++ b/SteamStorefrontAPI/appdetails/Classes/ReleaseDate.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Globalization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace SteamStorefrontAPI +{ + public class ReleaseDate + { + [JsonProperty("coming_soon")] + public bool ComingSoon { get; set; } + + [JsonProperty("date")] + public string Date { get; set; } + } +} diff --git a/SteamStorefrontAPI/appdetails/Classes/Screenshot.cs b/SteamStorefrontAPI/appdetails/Classes/Screenshot.cs new file mode 100644 index 0000000..dc84795 --- /dev/null +++ b/SteamStorefrontAPI/appdetails/Classes/Screenshot.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Globalization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace SteamStorefrontAPI +{ + + public class Screenshot + { + [JsonProperty("id")] + public long Id { get; set; } + + [JsonProperty("path_thumbnail")] + public string PathThumbnail { get; set; } + + [JsonProperty("path_full")] + public string PathFull { get; set; } + } +} diff --git a/SteamStorefrontAPI/appdetails/Classes/SteamApp.cs b/SteamStorefrontAPI/appdetails/Classes/SteamApp.cs new file mode 100644 index 0000000..16f13c9 --- /dev/null +++ b/SteamStorefrontAPI/appdetails/Classes/SteamApp.cs @@ -0,0 +1,119 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Globalization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Linq; + +namespace SteamStorefrontAPI.Classes +{ + public class SteamApp + { + [JsonProperty("type")] + public string Type { get; set; } + + [JsonProperty("name")] + public string Name { get; set; } + + [JsonProperty("steam_appid")] + public long SteamAppid { get; set; } + + [JsonProperty("required_age")] + public string RequiredAge { get; set; } + + [JsonProperty("is_free")] + public bool IsFree { get; set; } + + [JsonProperty("detailed_description")] + public string DetailedDescription { get; set; } + + [JsonProperty("about_the_game")] + public string AboutTheGame { get; set; } + + [JsonProperty("short_description")] + public string ShortDescription { get; set; } + + [JsonProperty("supported_languages")] + public string SupportedLanguages { get; set; } + + [JsonProperty("header_image")] + public string HeaderImage { get; set; } + + [JsonProperty("website")] + public string Website { get; set; } + + [JsonProperty("pc_requirements")] + public PcRequirements PcRequirements { get; set; } + + [JsonProperty("mac_requirements")] + public List MacRequirements { get; set; } + + [JsonProperty("linux_requirements")] + public List LinuxRequirements { get; set; } + + [JsonProperty("legal_notice")] + public string LegalNotice { get; set; } + + [JsonProperty("developers")] + public List Developers { get; set; } + + [JsonProperty("publishers")] + public List Publishers { get; set; } + + [JsonProperty("price_overview")] + public PriceOverview PriceOverview { get; set; } + + [JsonProperty("packages")] + public List Packages { get; set; } + + [JsonProperty("package_groups")] + public List PackageGroups { get; set; } + + [JsonProperty("platforms")] + public Platforms Platforms { get; set; } + + [JsonProperty("categories")] + public List Categories { get; set; } + + [JsonProperty("genres")] + public List Genres { get; set; } + + [JsonProperty("screenshots")] + public List Screenshots { get; set; } + + [JsonProperty("movies")] + public List Movies { get; set; } + + [JsonProperty("recommendations")] + public Recommendations Recommendations { get; set; } + + [JsonProperty("achievements")] + public Achievements Achievements { get; set; } + + [JsonProperty("release_date")] + public ReleaseDate ReleaseDate { get; set; } + + [JsonProperty("support_info")] + public SupportInfo SupportInfo { get; set; } + + [JsonProperty("background")] + public string Background { get; set; } + + public static SteamApp FromJson(string json) { + + var serializerSettings = new JsonSerializerSettings + { + MetadataPropertyHandling = MetadataPropertyHandling.Ignore, + DateParseHandling = DateParseHandling.None, + Converters = { + new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal } + }, + }; + + return JsonConvert.DeserializeObject(json, serializerSettings); + } + } +} diff --git a/SteamStorefrontAPI/appdetails/Classes/Sub.cs b/SteamStorefrontAPI/appdetails/Classes/Sub.cs new file mode 100644 index 0000000..5d5543e --- /dev/null +++ b/SteamStorefrontAPI/appdetails/Classes/Sub.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Globalization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace SteamStorefrontAPI +{ + + public class Sub + { + [JsonProperty("packageid")] + public long Packageid { get; set; } + + [JsonProperty("percent_savings_text")] + public string PercentSavingsText { get; set; } + + [JsonProperty("percent_savings")] + public long PercentSavings { get; set; } + + [JsonProperty("option_text")] + public string OptionText { get; set; } + + [JsonProperty("option_description")] + public string OptionDescription { get; set; } + + [JsonProperty("can_get_free_license")] + public string CanGetFreeLicense { get; set; } + + [JsonProperty("is_free_license")] + public bool IsFreeLicense { get; set; } + + [JsonProperty("price_in_cents_with_discount")] + public long PriceInCentsWithDiscount { get; set; } + } +} diff --git a/SteamStorefrontAPI/appdetails/Classes/SupportInfo.cs b/SteamStorefrontAPI/appdetails/Classes/SupportInfo.cs new file mode 100644 index 0000000..20ae03d --- /dev/null +++ b/SteamStorefrontAPI/appdetails/Classes/SupportInfo.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Globalization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; + +namespace SteamStorefrontAPI +{ + public class SupportInfo + { + [JsonProperty("url")] + public string Url { get; set; } + + [JsonProperty("email")] + public string Email { get; set; } + } +} diff --git a/SteamStorefrontAPI/packages.config b/SteamStorefrontAPI/packages.config new file mode 100644 index 0000000..c54e093 --- /dev/null +++ b/SteamStorefrontAPI/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/SteamStorefrontConsole/App.config b/SteamStorefrontConsole/App.config new file mode 100644 index 0000000..787dcbe --- /dev/null +++ b/SteamStorefrontConsole/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/SteamStorefrontConsole/Program.cs b/SteamStorefrontConsole/Program.cs new file mode 100644 index 0000000..b45b5ea --- /dev/null +++ b/SteamStorefrontConsole/Program.cs @@ -0,0 +1,32 @@ +using SteamStorefrontAPI; +using SteamStorefrontAPI.Classes; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; + + +namespace SteamStorefrontConsole +{ + class Program + { + static HttpClient client = new HttpClient(); + + static void Main(string[] args) + { + Task.Run(async () => await GetGame()).Wait(); + + } + + static async Task GetGame() + { + //var steamApp = Task.Run(async () => await AppDetails.GetAsync(637670)).Result; + //var steamApp = Task.Run(async () => await AppDetails.GetAsync(443790)).Result; + var steamApp = Task.Run(async () => await AppDetails.GetAsync(213670)).Result; + + Console.WriteLine(steamApp); + } + } +} diff --git a/SteamStorefrontConsole/Properties/AssemblyInfo.cs b/SteamStorefrontConsole/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..7c1acd7 --- /dev/null +++ b/SteamStorefrontConsole/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("SteamStorefrontConsole")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("SteamStorefrontConsole")] +[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("44aab32b-8986-48e0-8a08-42ce967d01f4")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SteamStorefrontConsole/SteamStorefrontConsole.csproj b/SteamStorefrontConsole/SteamStorefrontConsole.csproj new file mode 100644 index 0000000..5f027c2 --- /dev/null +++ b/SteamStorefrontConsole/SteamStorefrontConsole.csproj @@ -0,0 +1,58 @@ + + + + + Debug + AnyCPU + {44AAB32B-8986-48E0-8A08-42CE967D01F4} + Exe + SteamStorefrontConsole + SteamStorefrontConsole + v4.7.1 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + {76131abe-46bd-4a82-b5e6-f29a47f2f64d} + SteamStorefrontAPI + + + + \ No newline at end of file