HKOSharp
HKOSharp copied to clipboard
Unofficial C# Library of Hong Kong Observatory API
trafficstars

C# Library of Hong Kong Observatory Open Data API
What is HKOSharp?
HKOSharp is a C# library which allows you to access the Hong Kong Observatory Open Data API without handling bunches of Http requests, responses or JSON.
Todo list
- Update documentation for a recent rewrite.
- Translate document into Chinese Traditional and Chinese Simplified.
- Finish Weather class.
- ~Move from CircleCI to Travis CI.~ (Succeesfully moved to GitHub Workflow)
- Increase Code Coverage
Build
To build the project, you need to:
- Clone the repo to your machine.
- Open the
.slnfile with your favourite IDE. - That's it!
Installation
To use HKOSharp in your project, there are several ways to do so:
- Build the project and import the
.dllfiles manually; - Install from NuGet Package Manager;
Usage
For the full usage of HKOSharp, you should check HKOSharp Documentations.
WARNING: Library were rewritten recently and documentation may not be up-to-date.
Here are some examples of usages of HKOSharp:
// Imports namespace
using HKOSharp.LibHKOSharp;
// Gets today's Local Weather Forecast
var localForecast = Weather.GetLocalForecast(Language.English);
Console.Write("Description of today's forecast: ");
Console.Write(localForecast.ForecastDesc);
// Output:
// Description of today's forecast: Under the influence of an anticyclone aloft, the weather is ...
// Gets latest Earthquake information
var eqInfo = Earthquake.GetLatestEqInfoAsnyc(Language.TraditionalChinese);
Console.Write("Latest Earthquake Report Region: ");
Console.Write(eqInfo.Region);
// Output:
// Latest Earthquake Report Region: 班達海
Dependencies
- Newtonsoft.Json
- .NET Standard 2.0