Skip to content

Commit

Permalink
Merge changes (#6)
Browse files Browse the repository at this point in the history
Merge changes
  • Loading branch information
Vasar007 authored Jan 4, 2020
2 parents f132b8f + db3f6da commit 5390606
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 33 deletions.
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ SteamWepApiLib is a .NET wrapper for the Steam API. It provides a set of methods

The Steam API is not officially available or documented. So, all data in this library was either collected by trial and error from unofficial API documentation, and is therefore provided as-is.

## Installation

Install [NuGet package](https://www.nuget.org/packages/SteamWebApiLib).

## Usage examples

```cs
Expand All @@ -26,7 +30,7 @@ private static async Task Examples()

// Get full list of SteamApps.
SteamAppBriefInfoList steamAppList = await steamApiClient.GetAppListAsync();
Console.WriteLine($"Got {steamAppList.Apps.Length} items.");
Console.WriteLine($"Got {steamAppList.Apps.Length.ToString()} items.");

// Get details for SteamApp with ID 292030 (The Witcher 3: Wild Hunt).
SteamApp steamApp1 = await steamApiClient.GetSteamAppAsync(292030);
Expand All @@ -42,23 +46,23 @@ private static async Task Examples()

// Get details for Package with same ID for region JP.
PackageInfo package2 = await steamApiClient.GetPackageInfoAsync(68179, CountryCode.Japan);
Console.WriteLine($"Got response for {package1.Name}.");
Console.WriteLine($"Got response for {package2.Name}.");

// Get a list of featured games.
FeaturedApps featured1 = await steamApiClient.GetFeaturedAppsAsync();
Console.WriteLine($"Got {featured1.FeaturedWin.Length} items for Winodws.");
Console.WriteLine($"Got {featured1.FeaturedWin.Length.ToString()} items for Windows.");

// Get a list of featured games for region DE.
FeaturedApps featured2 = await steamApiClient.GetFeaturedAppsAsync(CountryCode.Germany);
Console.WriteLine($"Got {featured2.FeaturedWin.Length} items for Winodws.");
Console.WriteLine($"Got {featured2.FeaturedWin.Length.ToString()} items for Windows.");

// Get a list of featured games grouped by category.
FeaturedCategories featuredCategories1 = await steamApiClient.GetFeaturedCategoriesAsync();
Console.WriteLine($"Got {featuredCategories1.TopSellers.Items.Length} top sellers items.");
Console.WriteLine($"Got {featuredCategories1.TopSellers.Items.Length.ToString()} top sellers items.");

// Get a list of featured games grouped by category for region US.
FeaturedCategories featuredCategories2 = await steamApiClient.GetFeaturedCategoriesAsync(CountryCode.USA);
Console.WriteLine($"Got {featuredCategories2.TopSellers.Items.Length} top sellers items.");
Console.WriteLine($"Got {featuredCategories2.TopSellers.Items.Length.ToString()} top sellers items.");
}
```

Expand All @@ -81,8 +85,8 @@ This project is licensed under the terms of the [Apache License 2.0](LICENSE).

### Third party software and libraries used

Newtonsoft.Json https://www.newtonsoft.com/json
#### [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json)

Copyright (c) 2007 James Newton-King
Copyright © 2007 James Newton-King

License (MIT) https://raw.githubusercontent.com/JamesNK/Newtonsoft.Json/master/LICENSE.md
License: [MIT](https://github.com/JamesNK/Newtonsoft.Json/blob/master/LICENSE.md)
6 changes: 5 additions & 1 deletion SteamWebApiLib/SteamWebApiLib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@ The Steam API is not officially available or documented. So, all data in this li
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageProjectUrl>https://github.com/Vasar007/SteamWebApiLib</PackageProjectUrl>
<RepositoryType>git</RepositoryType>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<Copyright>Copyright © 2019 Vasily Vasilyev ([email protected])</Copyright>
<ApplicationIcon></ApplicationIcon>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
<NoWarn>1701;1702;CS1591</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion SteamWebApiLib/SteamWebApiLib.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<projectUrl>$projectUrl$</projectUrl>
<repositoryUrl>$repositoryUrl$</repositoryUrl>
<repositoryType>$repositoryType$</repositoryType>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<requireLicenseAcceptance>$requireLicenseAcceptance$</requireLicenseAcceptance>
<description>$description$</description>
<copyright>$copyright$</copyright>
<tags>$tags$</tags>
Expand Down
31 changes: 22 additions & 9 deletions SteamWebApiLibConsoleApp/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,30 @@ namespace SteamWebApiLibConsoleApp
{
internal static class Program
{
private static async Task Main()
private static async Task<int> Main()
{
try
{
Console.WriteLine("Console application started.");

await Examples();

return 0;
}
catch (Exception ex)
{
Console.WriteLine(ex);
string exceptionMessage = $"Exception occurred in {nameof(Main)} method. " +
$"{Environment.NewLine}{ex.ToString()}";
Console.WriteLine(exceptionMessage);

return -1;
}
finally
{
Console.WriteLine("Console application stopped.");
Console.WriteLine("Press any key to close this window...");
Console.ReadKey();
}
Console.ReadLine();
}

private static async Task Examples()
Expand All @@ -30,7 +43,7 @@ private static async Task Examples()

// Get full list of SteamApps.
SteamAppBriefInfoList steamAppList = await steamApiClient.GetAppListAsync();
Console.WriteLine($"Got {steamAppList.Apps.Length} items.");
Console.WriteLine($"Got {steamAppList.Apps.Length.ToString()} items.");

// Get details for SteamApp with ID 292030 (The Witcher 3: Wild Hunt).
SteamApp steamApp1 = await steamApiClient.GetSteamAppAsync(292030);
Expand All @@ -46,23 +59,23 @@ private static async Task Examples()

// Get details for Package with same ID for region JP.
PackageInfo package2 = await steamApiClient.GetPackageInfoAsync(68179, CountryCode.Japan);
Console.WriteLine($"Got response for {package1.Name}.");
Console.WriteLine($"Got response for {package2.Name}.");

// Get a list of featured games.
FeaturedApps featured1 = await steamApiClient.GetFeaturedAppsAsync();
Console.WriteLine($"Got {featured1.FeaturedWin.Length} items for Winodws.");
Console.WriteLine($"Got {featured1.FeaturedWin.Length.ToString()} items for Windows.");

// Get a list of featured games for region DE.
FeaturedApps featured2 = await steamApiClient.GetFeaturedAppsAsync(CountryCode.Germany);
Console.WriteLine($"Got {featured2.FeaturedWin.Length} items for Winodws.");
Console.WriteLine($"Got {featured2.FeaturedWin.Length.ToString()} items for Windows.");

// Get a list of featured games grouped by category.
FeaturedCategories featuredCategories1 = await steamApiClient.GetFeaturedCategoriesAsync();
Console.WriteLine($"Got {featuredCategories1.TopSellers.Items.Length} top sellers items.");
Console.WriteLine($"Got {featuredCategories1.TopSellers.Items.Length.ToString()} top sellers items.");

// Get a list of featured games grouped by category for region US.
FeaturedCategories featuredCategories2 = await steamApiClient.GetFeaturedCategoriesAsync(CountryCode.USA);
Console.WriteLine($"Got {featuredCategories2.TopSellers.Items.Length} top sellers items.");
Console.WriteLine($"Got {featuredCategories2.TopSellers.Items.Length.ToString()} top sellers items.");
}
}
}
37 changes: 24 additions & 13 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,40 @@
version: '{build}'
image: Visual Studio 2017

pull_requests:
do_not_increment_build_number: true

branches:
only:
only:
- master
- develop

nuget:
disable_publish_on_pr: true
configuration:
- Debug
- Release

matrix:
fast_finish: true

before_build:
- cmd: dotnet restore
- cmd: dotnet restore

build:
verbosity: minimal

after_build:
- dotnet test
- dotnet pack "SteamWebApiLib" -c Release
- dotnet test
- dotnet pack "SteamWebApiLib" -c Release

artifacts:
- path: SteamWebApiLib\bin\Release\*.nupkg
- path: SteamWebApiLib\bin\Release\*.nupkg

deploy:
- provider: Environment
name: nuget.org
on:
- provider: Environment
name: SteamWebApiLib
on:
branch: master
configuration: Release

pull_requests:
do_not_increment_build_number: true

nuget:
disable_publish_on_pr: true

0 comments on commit 5390606

Please sign in to comment.