TLY.ShortUrl 1.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package TLY.ShortUrl --version 1.0.0                
NuGet\Install-Package TLY.ShortUrl -Version 1.0.0                
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="TLY.ShortUrl" Version="1.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TLY.ShortUrl --version 1.0.0                
#r "nuget: TLY.ShortUrl, 1.0.0"                
#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 TLY.ShortUrl as a Cake Addin
#addin nuget:?package=TLY.ShortUrl&version=1.0.0

// Install TLY.ShortUrl as a Cake Tool
#tool nuget:?package=TLY.ShortUrl&version=1.0.0                

TLY.ShortUrl

A .NET library for creating shortened URLs using the T.ly URL shortening service.

Getting Started

To use TLY.ShortUrl, you'll need an API key from T.ly. You can obtain one by registering at their official website.

Installation

Install the package via NuGet:

dotnet add package TLY.ShortUrl

Usage

Here's how to use the library to shorten a URL:

using TLY.ShortUrl;

class Program
{
    static async Task Main(string[] args)
    {
        string apiKey = "YOUR_API_KEY"; // Replace with your actual TLY API key.
        var tlyContext = new TlyContext(apiKey);

        string longUrl = "http://example.com/";
        string description = "Social Media Link";

        var shortenedLink = await tlyContext.GetShortUrlAsync(longUrl, description);
        Console.WriteLine($"Shortened URL: {shortenedLink.short_url}");
    }
}

Classes and Methods

TlyContext

  • Task<ShortenedLinkResponse> GetShortUrlAsync(string longUrl, string description, string domain = "https://t.ly", bool publicStats = true)
    Initiates a request to shorten a URL and returns a ShortenedLinkResponse object containing details about the shortened URL.

ShortenedLinkResponse

  • Properties:
    • string short_url - The shortened URL.
    • string description - A description of the shortened URL.
    • string long_url - The original URL before shortening.
    • string domain - The domain used for the shortened URL.
    • string short_id - A unique identifier for the shortened URL.
    • int? expire_at_views - The number of views after which the link will expire.
    • DateTime? expire_at_datetime - The date and time when the link will expire.
    • bool public_stats - Indicates whether the statistics of the shortened URL are public.
    • DateTime created_at - The date and time when the shortened URL was created.
    • DateTime updated_at - The date and time when the shortened URL was last updated.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request.

License

This project is licensed under the unlicense - see the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.3 111 7/2/2024
1.0.2 104 7/1/2024 1.0.2 is deprecated because it has critical bugs.
1.0.1 153 6/20/2024
1.0.0 826 5/17/2024