Simple to use api-client for Telegra.ph. (Adapted for .net Core 2.1)
C# .NET Core 2.1
Install last varsion
Install-Package Kvyk.Telegraph
Package Name | Release | Version |
---|---|---|
Kvyk.Telegraph |
NuGet | 1.0.2 |
You can find all documentation on Wiki
Add using
to the top of your file
using Kvyk.Telegraph;
using Kvyk.Telegraph.Models;
Let's create first account
var client = new TelegraphClient();
Account account = await client.CreateAccount(
"MyFirstAccount", //Short name
"I am", //Author name
"https://example.com" //Author link
);
client.Token = account.AccessToken; //Your token. Save it to use your account in the future
Now we can create your first page
var nodes = new List<Node> //Page is an array of nodes
{
Node.H3("Test header"),
Node.P("Hello, World!"),
Node.ImageFigure("https://telegra.ph/images/logo.png", "Logo"),
};
var page = await client.CreatePage(
"Test page", //Page title
nodes
);
var url = page.Url; //Here is your page url
The example of the created page: https://telegra.ph/Test-page-06-11
This is my first NuGet package, so I'm waiting for a feedback!
Please, tell me about any things I've missed or skiped, any features about code and comments, project description and design of repo. I will be happy to get any feedback.
Use issues or just send me email: [email protected]