Weeb.net 1.0.4

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

// Install Weeb.net as a Cake Tool
#tool nuget:?package=Weeb.net&version=1.0.4                

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

//...
	WeebClient weebClient = new WeebClient();
	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; }
    }
There are no supported framework assets in this 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.7 1,687 4/23/2018
1.0.6 913 4/22/2018
1.0.5 905 3/4/2018
1.0.4 927 3/4/2018
1.0.3 1,048 9/16/2017
1.0.2 920 9/16/2017
1.0.1 987 9/14/2017
1.0.0 944 9/14/2017

Added Support for Wolke Tokens