KiwiSoft.Bitly 1.0.2

dotnet add package KiwiSoft.Bitly --version 1.0.2
NuGet\Install-Package KiwiSoft.Bitly -Version 1.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="KiwiSoft.Bitly" Version="1.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add KiwiSoft.Bitly --version 1.0.2
#r "nuget: KiwiSoft.Bitly, 1.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install KiwiSoft.Bitly as a Cake Addin
#addin nuget:?package=KiwiSoft.Bitly&version=1.0.2

// Install KiwiSoft.Bitly as a Cake Tool
#tool nuget:?package=KiwiSoft.Bitly&version=1.0.2

KiwiSoft.Bitly

This nuget package is meant to be used to shrink long Url into shorter one with the helps of Bitly Rest API. You need to create your own subscription with https://bitly.com before you can use this nuget package.
Once you have a subscription, you need to get a group guid id and generate a token. Those informations will be used by the package while communicating with the Bitly Rest API.
There are two way to pass in GroupId and Token to the instant object
A) By adding new section on appsettings.json as see below :
appsettings.json
{
  "KiwiSoft.Bitly": {
    "GroupGuidId": "GKcgnMiNain",
    "Token": "563e96dfffd3d5e744dca8172719b01aed23eb09"
  }
}

And on the C# code, you just need to call new Shortener() to create a new instant.

  Shortener shortener = new Shortener();
  ReturnURL result = await shortener.CreateAsync("https://edi.wang/post/2019/4/24/how-to-pack-a-net-core-class-library-and-upload-to-nuget");
  string url = result.Status?result.Url:string.Empty;
B) By instantiating Configuration class and pass it to the constructor :
  Configuration configuration = new Configuration();
  configuration.GroupGuid = "GKcgnMiNain";
  configuration.Token = "563e96dfffd3d5e744dca8172719b01aed23eb09";

  Shortener shortener = new Shortener(configuration);
  ReturnURL result = await shortener.CreateAsync("https://edi.wang/post/2019/4/24/how-to-pack-a-net-core-class-library-and-upload-to-nuget");
  string url = result.Status?result.Url:string.Empty;

You can find out whether the operation is successful or not by looking at the value of Status property on ReturnUrl. And the shortened url can be retrieved from Url property.

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.2 478 1/29/2022
1.0.1 408 1/22/2022
1.0.0 454 1/17/2022