KuttSharp
🔪 .NET Package for kutt.it url shortener
Install / Use
/learn @avestura/KuttSharpREADME
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
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
}
Related Skills
node-connect
349.9kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.9kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.9kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
