Artilities.NET 1.1.4

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

// Install Artilities.NET as a Cake Tool
#tool nuget:?package=Artilities.NET&version=1.1.4                

Artilities.NET

An unofficial C# Wrapper for the Artilities REST API

What can this Wrapper do?

This wrapper currently supports getting an Idea, Getting a challenge Idea, Looking up artist slang. The other API functions like getting patreons and getting banners will hopefully follow soon.

Where can I get the package?

You can download the package on NuGet or soon here on GitHub

DOCUMENTATION

Getting an Idea

You can get a random Idea from the Artilities Database using the getIdea() function, this function will return a Dictionary with the following keys: english, russian, delayTime, statusCode, raw.

  • english returns the result Idea in English
  • russian returns the result Idea in Russian (You might need to change the text output to UTF-16 to be able to see it)
  • delayTime returns the time it took for the server to respond in MS
  • statusCode returns the Web Response (in best case its 200)
  • raw returns the raw response JSON
Note

If there was an error during the request, the Dictionary will return null

Example Usage
            Console.OutputEncoding = System.Text.Encoding.UTF8; //This line is to make the console display the russian language
            Dictionary<string, string> IdeaDict = Artilities.main.GetIdea();
            if (IdeaDict != null)
            {
                Console.WriteLine("Your Idea: " + IdeaDict["english"]);
                Console.WriteLine("Russian: " + IdeaDict["russian"]);
                Console.WriteLine("Server Response: " + IdeaDict["statusCode"]);
                Console.WriteLine("Server Response Time: " + IdeaDict["delayTime"] + "ms");
                Console.WriteLine("Raw output: " + IdeaDict["raw"]);
            }
            else
            {
                Console.WriteLine("There was an error in the request.");
            }
Output
Your Idea: Secretary Cat
Russian: Котик-секретарь
Server Response: 200
Server Response Time: 149ms
Raw output: {
  "status_code": 200,
  "generated_idea": {
    "ru": "Котик-секретарь",
    "eng": "Secretary Cat"
  },
  "execution_time": 149
}

Getting a challenge

You can get a random Challenge from Artilities using the getChallenge() function, this function will return a Dictionary with the following keys: english, russian, delayTime, statusCode, raw.

  • english returns the result challenge in English
  • russian returns the result challenge in Russian (You might need to change the text output to UTF-16 to be able to see it)
  • delayTime returns the time it took for the server to respond in MS
  • statusCode returns the Web Response (in best case its 200)
  • raw returns the raw response JSON
Note

If there was an error during the request, the Dictionary will return null

Example Usage
            Console.OutputEncoding = System.Text.Encoding.UTF8; //This line is to make the console display the russian language
            Dictionary<string, string> challengeDict = Artilities.main.GetChallenge();
            if (challengeDict != null)
            {
                Console.WriteLine("Your challenge: " + challengeDict["english"]);
                Console.WriteLine("Russian: " + challengeDict["russian"]);
                Console.WriteLine("Server Response: " + challengeDict["statusCode"]);
                Console.WriteLine("Server Response Time: " + challengeDict["delayTime"] + "ms");
                Console.WriteLine("Raw output: " + challengeDict["raw"]);
            }
            else
            {
                Console.WriteLine("There was an error in the request.");
            }

Output
Your challenge: draw something using only two colors
Russian: нарисуй что-нибудь, используя только два цвета
Server Response: 200
Server Response Time: 30ms
Raw output: {
  "status_code": 200,
  "generated_challenge": {
    "ru": "нарисуй что-нибудь, используя только два цвета",
    "eng": "draw something using only two colors"
  },
  "execution_time": 30
}

Looking up artist slang in the Artilities Database

You can look up artist slang from the artilities database using the GetDictionaryEntry() function, this function will return a Dictionary with the following keys: word, description, delayTime, statusCode, raw.

  • word returns the first best word result from the database
  • description returns the description / meaning of the returned word
  • delayTime returns the time it took for the server to respond in MS
  • statusCode returns the Web Response (in best case its 200)
  • raw returns the raw response JSON
Note
  • If there was an error during the request, the Dictionary will return null
  • In case the database has found no words to return, word and description will return null
  • The function GetDictionaryEntry() requires a string as search query input
Example Usage
            Dictionary<string, string> DictLookup = Artilities.main.GetDictionaryEntry("UFO"); //In this case I'm looking up the term "UFO", which means "up for offer"
            if (DictLookup != null && DictLookup["word"] != null)
            {
                Console.WriteLine("Word: " + DictLookup["word"]);
                Console.WriteLine("Description: " + DictLookup["description"]);
                Console.WriteLine("Server response Time: " + DictLookup["delayTime"] + "ms");
                Console.WriteLine("Server response Code: " + DictLookup["statusCode"]);
                Console.WriteLine("Raw response: " + DictLookup["raw"]);
            }
            else
            {
                Console.WriteLine("There was an error in the request.");
            }
Output
Word: UFO
Description: Short for Up For Offers.
Server response Time: 58ms
Server response Code: 200
Raw response: {
  "status_code": 200,
  "query_results": [
    [
      "UFO",
      "Short for Up For Offers."
    ]
  ],
  "execution_time": 58
}

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.1 is compatible. 
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.2.1 482 9/17/2022
1.2.0 404 9/5/2022
1.1.6 391 8/25/2022
1.1.5 479 7/12/2022
1.1.4 456 7/11/2022
1.1.3 437 7/11/2022
1.1.2 452 7/11/2022
1.1.1 482 7/11/2022
1.1.0 472 7/11/2022
0.8.0 478 7/11/2022