Artilities.NET
1.1.5
See the version list below for details.
dotnet add package Artilities.NET --version 1.1.5
NuGet\Install-Package Artilities.NET -Version 1.1.5
<PackageReference Include="Artilities.NET" Version="1.1.5" />
paket add Artilities.NET --version 1.1.5
#r "nuget: Artilities.NET, 1.1.5"
// Install Artilities.NET as a Cake Addin #addin nuget:?package=Artilities.NET&version=1.1.5 // Install Artilities.NET as a Cake Tool #tool nuget:?package=Artilities.NET&version=1.1.5
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 You can also:
- Type
Install-Package Artilities.NET -Version 1.1.5
into the Package Manager - Type
dotnet add package Artilities.NET --version 1.1.5
into the command prompt, note that you need to havedotnet
installed - Reference the Dependency using
<PackageReference Include="Artilities.NET" Version="1.1.5" />
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 Englishrussian
returns the result Idea in Russian (You might need to change the text output toUTF-16
to be able to see it)delayTime
returns the time it took for the server to respond in MSstatusCode
returns the Web Response (in best case its200
)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 Englishrussian
returns the result challenge in Russian (You might need to change the text output toUTF-16
to be able to see it)delayTime
returns the time it took for the server to respond in MSstatusCode
returns the Web Response (in best case its200
)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 databasedescription
returns the description / meaning of the returnedword
delayTime
returns the time it took for the server to respond in MSstatusCode
returns the Web Response (in best case its200
)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
anddescription
will returnnull
- 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
}
Get Artilities Banners (Contributed by Slimakoi)
You can get Artilities Banners and their properties using the getBanners()
function, this function will return a Dictionary with the following keys: bannerUrl
, bannerImage
, delayTime
, statusCode
, raw
, language
.
bannerUrl
returns the URL the banner is linked tobannerImage
returns the source URL of the bannerlanguage
returns the banners language (usuallynull
)delayTime
returns the time it took for the server to respond in MSstatusCode
returns the Web Response (in best case its200
)raw
returns the raw response JSON
Note
- If there was an error during the request, the Dictionary will return
null
- The function
getBanners()
does not share the classmain
like the other functions, instead it uses the classother
, as it is part of other features of the Artilities API
Example Usage
Dictionary<string, string> bannerDict = Artilities.other.GetBanners();
if (bannerDict != null)
{
Console.WriteLine("Banner Image: " + bannerDict["bannerImage"]);
Console.WriteLine("Banner Link: " + bannerDict["bannerUrl"]);
Console.WriteLine("Response Code: " + bannerDict["statusCode"]);
Console.WriteLine("Response Time: " + bannerDict["delayTime"] + "ms");
Console.WriteLine("Language: " + bannerDict["language"]);
Console.WriteLine("Raw Json: " + bannerDict["raw"]);
}
else
{
Console.WriteLine("There was an error in the request");
}
Output
Banner Image: https://i.imgur.com/pKmfznm.gif
Banner Link: https://discord.com/invite/u7dBmKyMWa
Response Code: 200
Response Time: 57ms
Language:
Raw Json: {
"status_code": 200,
"details": {
"banner_url": "https://discord.com/invite/u7dBmKyMWa",
"banner_image": "https://i.imgur.com/pKmfznm.gif",
"language": ""
},
"execution_time": 57
}
Product | Versions 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. |
-
.NETCoreApp 3.1
- Newtonsoft.Json (>= 13.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.