All Projects → avestura → KuttSharp

avestura / KuttSharp

Licence: MIT license
🔪 .NET Package for kutt.it url shortener

Programming Languages

C#
18002 projects

Projects that are alternatives of or similar to KuttSharp

IGeekFan.AspNetCore.Knife4jUI
support .NET Core3.0+,.NET Standard2.0 Swagger UI knife4j ui,you can use NSwagger or Swashbuckle.AspNetCore in packages
Stars: ✭ 178 (+513.79%)
Mutual labels:  nuget, netstandard
DotNetGraph
Create GraphViz DOT graph with .NET / C#
Stars: ✭ 57 (+96.55%)
Mutual labels:  netstandard, netstandard20
Vs Validation
Common input and integrity validation routines for Visual Studio and other applications
Stars: ✭ 48 (+65.52%)
Mutual labels:  nuget, netstandard
Xamarinmediamanager
Cross platform Xamarin plugin to play and control Audio and Video
Stars: ✭ 647 (+2131.03%)
Mutual labels:  nuget, netstandard
Vortice.Mathematics
Cross platform .NET math library.
Stars: ✭ 46 (+58.62%)
Mutual labels:  netstandard, netstandard20
Weixinmpsdk
微信全平台 SDK Senparc.Weixin for C#,支持 .NET Framework 及 .NET Core、.NET 6.0。已支持微信公众号、小程序、小游戏、企业号、企业微信、开放平台、微信支付、JSSDK、微信周边等全平台。 WeChat SDK for C#.
Stars: ✭ 7,098 (+24375.86%)
Mutual labels:  nuget, netstandard20
Zipstorer
A Pure C# Class to Store Files in Zip
Stars: ✭ 139 (+379.31%)
Mutual labels:  nuget, netstandard
lastfm
Portable .Net library for Last.fm
Stars: ✭ 87 (+200%)
Mutual labels:  nuget, netstandard
Megaapiclient
MegaApiClient is a C# .Net library to access http://mega.co.nz / http://mega.nz cloud storage and file hosting service.
Stars: ✭ 151 (+420.69%)
Mutual labels:  nuget, netstandard
Ether.network
https://github.com/Eastrall/Sylver
Stars: ✭ 147 (+406.9%)
Mutual labels:  nuget, netstandard
Vs Threading
The Microsoft.VisualStudio.Threading is a xplat library that provides many threading and synchronization primitives used in Visual Studio and other applications.
Stars: ✭ 585 (+1917.24%)
Mutual labels:  nuget, netstandard
XamarinFormsPinView
PIN keyboard for Xamarin.Forms.
Stars: ✭ 83 (+186.21%)
Mutual labels:  netstandard, netstandard20
Opengl.net
Modern OpenGL bindings for C#.
Stars: ✭ 473 (+1531.03%)
Mutual labels:  nuget, netstandard
Computesharp
A .NET 5 library to run C# code in parallel on the GPU through DX12 and dynamically generated HLSL compute shaders, with the goal of making GPU computing easy to use for all .NET developers! 🚀
Stars: ✭ 982 (+3286.21%)
Mutual labels:  nuget, netstandard
Vortice.windows
.NET standard bindings for DirectX, WIC, Direct2D1, XInput, XAudio and X3DAudio
Stars: ✭ 427 (+1372.41%)
Mutual labels:  nuget, netstandard
Colore
A powerful C# library for Razer Chroma's SDK
Stars: ✭ 121 (+317.24%)
Mutual labels:  nuget, netstandard
REstate
Portable state-flows (state-machine based workflows)
Stars: ✭ 35 (+20.69%)
Mutual labels:  nuget, netstandard
Ubiety.Xmpp.Core
XMPP library for .NET Core
Stars: ✭ 32 (+10.34%)
Mutual labels:  nuget, netstandard20
Eventflow
Async/await first CQRS+ES and DDD framework for .NET
Stars: ✭ 1,932 (+6562.07%)
Mutual labels:  nuget, netstandard
aspnetcore-authentication-apikey
Easy to use and very light weight Microsoft style API Key Authentication Implementation for ASP.NET Core. It can be setup so that it can accept API Key in Header, Authorization Header, QueryParams or HeaderOrQueryParams.
Stars: ✭ 215 (+641.38%)
Mutual labels:  netstandard, netstandard20

KuttSharp

.NET Package for kutt.it url shortener

⚠️ WARNING

⚠️ KuttSharp currently only supports v1 of the Kutt API. I have no plans to support v2, therefore you might want to look for an alternative.

ℹ️ Since the newer version of Kutt API uses OpenAPI, the best option probably would be to just use an OpenAPI client generator.

Installation

NuGet NuGet Downloads Build status

Simply add KuttSharp nuget package to your project

API

First create a new instance of KuttApi then use examples below:

// Use defualt Kutt server
var api = new KuttApi("apiKey");

// Use a self-hosted Kutt server as string or System.Uri
var api = new KuttApi("apiKey", "https://MyOwnSelfHostedKutt.it")

Submit

var submitedItem = await api.SubmitAsync(
      target: "https://example.com",
      customUrl: "customUrl",
      password: "password",
      reuse: true
    );

// Now you can use properties of created item
if (submitedItem.IsPasswordRequired)
{
    Console.WriteLine(submitedItem.CreatedAt.Year);
}

Delete

await api.DeleteAsync(id: "url_id");

GetUrls

var list = await api.GetUrlsAsync();
Console.WriteLine($"First item visits count: {list[0].Visits}");

GetStats

var stats = await api.GetStatsAsync(id: "url_id");

Console.WriteLine(stats.LastWeek.ClientStats.Referrer[0].Name);

Error handling

var api = new KuttApi("apiKey");

try
{
    var result = await api.SubmitAsync("https://example.com", reuse: true);
}
catch (KuttException kex) when (kex.Message == "No id has been provided.")
{
    // Handle custom kutt exception
}
catch (KuttException)
{
    // Handle all other kutt exceptions
}
catch
{
    // Handle other errors
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].