Giter Club home page Giter Club logo

drycodes.net-wrapper's Introduction

Drycodes.NET-Wrapper

A names.drycodes.com API wrapper for .NET, serving the purpose of random name generation.

What actually is this?

This is an API wrapper for the site listed above. This site provides a variety of random name and number generators through an API. All of which is deserialized via JSON and fed to you in an easy-to-use form via a variety of methods.

How can I use it?

You have two options, you can either reference the NuGet package, or you can download one of the releases and directly reference the DLL assembly.

Okay, I've added it to my project... what now?

Drycodes.NET is super simple, and extremely easy. To begin using it in your code, do the following:

DrycodesApi api = new();

Now you have created a Drycodes API object and you can use a variety of the methods via your api object.

Here is an example:

string boyName = api.GenerateSingle(RequestType.Boys);
Console.WriteLine(boyName);

And... boom! It's as simple as that. The following code will simply generate one random boy name and output it to the console.

If you want to generate a list (or array, to be more specific) of names, you can do the following:

string[] objects = api.GenerateMany(RequestType.Objects);
foreach(string obj in objects){
  Console.WriteLine(obj);
}

The following code will retrieve 10 random objects, iterate through each one and output it to the console.

There are a couple of parameters that are defaulted, but you can modify them to your liking, here are a couple examples:

string[] planets = api.GenerateMany(RequestType.Planets, 100);

This will generate 100 planets and store them in the string array. The default quantity, without any arguments is 10.

The last parameter is a seperator between the spaces between words, this is really done for one reason, and that's because the API automatically swaps spaces for underscores. With this wrapper, I made it a bit easier for all of you and got rid of all those by default, but you can change the seperator (if you want) like so:

string game = api.GenerateSingle(RequestType.Games, "_!_");
Console.WriteLine(game);

This will generate something along the lines of Mario_!_Party. You can even remove the space entirely by just using "" for the seperator and that'll remove all spaces.

Thanks for checking this out. If you have any questions, or issues, feel free to let me know! PRs are always welcome :)

drycodes.net-wrapper's People

Contributors

csmir avatar renderbr avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.