项目作者: aechan

项目描述 :
Unofficial C# wrapper for @poetapp's Frost API.
高级语言: C#
项目地址: git://github.com/aechan/FrostSharp.git
创建时间: 2018-02-10T02:02:02Z
项目社区:https://github.com/aechan/FrostSharp

开源协议:

下载


FrostSharp

NuGet version

.NET Core library wrapping po.et’s Frost API.

Updated for Frost API v0.1

Usage

Install:

  1. dotnet add package FrostSharp

or

  1. Install-Package FrostSharp

Examples:

  1. // Your api key
  2. string APIKey = "your api key here";
  3. // Create a Frost configuration with all default values (should work for most people)
  4. var Config = new Configuration();
  5. // do we want all HTTP request logging to stdout (mostly useful for testing)
  6. bool logging = false;
  7. // Create the client we will use.
  8. var client = new Frost(APIKey, Config, logging);
  9. // Create a work (Work name, date created, date published, author name, work content)
  10. WorkAttributes myWork = new WorkAttribute("Work Name", DateTime.UtcNow, DateTime.UtcNow, "Alec Chan", "This is the content of the work");
  11. // Post the work onto the po.et network (runs asynchronously)
  12. string myWorkId = await client.CreateWork(myWork);
  13. // Look up a work by work ID
  14. WorkAttributes thisIsTheSameWorkWeJustPosted = await client.GetWork(myWorkId);
  15. // Get all the works that your API key has posted
  16. List<WorkAttributes> listOfWorks = await client.GetAllWorks();

Development

Building library:
cd FrostSharp && dotnet build

Running tests:
cd FrostSharp.Tests && dotnet test

To contribute:

  • Clone this repo
  • Create an integration branch (e.g. -integration)
  • Make changes
  • Submit a pull request to pull changes into master