Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

actually-akac/Freenom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Freenom

An async C# library for automatically renewing Freenom domains.

Warning
This library doesn't implement domain registration and configuration web API routes, as these can be easily abused for spam.

Usage

Provides an easy interface for interacting with the Freenom web API routes. This allows you to programmatically renew your domains.

To get started, add the library into your solution with either the NuGet Package Manager or the dotnet CLI.

dotnet add package Freenom.NET

For the primary classes to become available, import the used namespace.

using Freenom;

Need more examples? Under the Example directory you can find a working demo project that implements this library.

Dependencies

  • HtmlAgilityPack (GitHub) (Website): For efficiently parsing the DOM and reading data out of it.

Code Samples

Creating a new Freenom client

FreenomClient freenom = new();

Logging in

string name = await freenom.Login("EMAIL", "PASSWORD");

Getting basic account information

AccountInfo info = await freenom.GetAccountInfo();

Getting all domains under the account that might be renewable

RenewalDomain[] renewals = await freenom.GetRenewals();

Filtering domains that are currently renewable using LINQ

RenewalDomain[] renewable = renewals.Where(x => x.Renewable).ToArray();

Renewing a domain for 12 months

long orderId = await freenom.RenewDomain(6236693445, 12);

Features

  • Built for .NET 6 and .NET 7
  • Fully async
  • Extensive XML documentation
  • Custom exceptions (FreenomException) for advanced catching
  • Automatically renew Freenom domains that are expiring soon
  • Automatic request retries
  • Example project to show the usage of the library

Available methods

  • Task<string> Login(string email, string password)
  • Task Logout()
  • Task<AccountInfo> GetAccountInfo()
  • Task<RenewalDomain[]> GetRenewals()
  • Task<long> RenewDomain(long id, int months)

References

This is a community-ran library. Not affiliated with OpenTLD BV.