Weeb.net
1.0.7
dotnet add package Weeb.net --version 1.0.7
NuGet\Install-Package Weeb.net -Version 1.0.7
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="Weeb.net" Version="1.0.7" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Weeb.net --version 1.0.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Weeb.net, 1.0.7"
#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 Weeb.net as a Cake Addin #addin nuget:?package=Weeb.net&version=1.0.7 // Install Weeb.net as a Cake Tool #tool nuget:?package=Weeb.net&version=1.0.7
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Token
To use the weeb.sh services you need an authentication token. You can request one at devs@weeb.sh
Usage
Creating a client and authentication
//...
// For example "Sora", "1.0.0". These can be ommited and will default to Weeb.net and its version.
WeebClient weebClient = new WeebClient("YourBotName", "YourBotVersion");
string token = "YOUR TOKEN";
public async Task InitializeAsync()
{
//Will print current weeb.sh API version and Weeb.net wrapper version
await weebClient.Authenticate(token, TokenType.Bearer); //or TokenType.Wolke
}
//...
Getting all available tags
//...
public async Task<TagsData> GetTagsAsync(bool hidden)
{
return await weebClient.GetTagsAsync(hidden); //hidden is always defaulted to false
}
//...
Getting all available types
//...
public async Task<TypesData> GetTypesAsync(bool hidden)
{
return await weebClient.GetTypesAsync(hidden); //hidden is always defaulted to false
}
//...
Getting Random image with type and or tags
You must have at least either type or tags!
UPDATE: There have been som minor changes to accomodate new features.
fileType consists of: Jpg, png, gif, any
. Jpg and jpeg are treated as equal.
NsfwSearch consists of: false, ture, only
//...
public async Task<RandomData> GetTypesAsync(string type, IEnumerable<string> tags,FileType fileType, NsfwSearch nsfw,bool hidden)
{
var result = await weebClient.GetRandomAsync(type, tags, fileType, hidden, nsfw); //hidden and nsfw are always defaulted to false
if (result == null)
{
//Nothing was found do smth...
//...
return null
}
return result
}
//...
Models
TagsData
public class TagsData
{
internal string Status { get; set; } //cannot be used in your program. only used for internal wrapper things :P
public List<string> Tags { get; set; }
}
TypesData
public class TypesData
{
internal string Status { get; set; } //cannot be used in your program. only used for internal wrapper things :P
public List<string> Types { get; set; }
}
RandomData
public class RandomData
{
public string Id { get; set; }
public string BaseType { get; set; }
public string FileType { get; set; }
public string MimeType { get; set; }
public string Account { get; set; }
public bool Hidden { get; set; }
public bool Nsfw { get; set; }
public List<Tags> Tags { get; set; }
public string Url { get; set; }
}
public class Tags
{
public string Name { get; set; }
public bool Hidden { get; set; }
public string User { get; set; }
}
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 | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. 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.
-
.NETStandard 2.0
- Newtonsoft.Json (>= 11.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.
Added default and settable User-Agent