Skip to content

Latest commit

 

History

History
73 lines (49 loc) · 2.03 KB

README.md

File metadata and controls

73 lines (49 loc) · 2.03 KB

memerator-sdk-cs

An implementation of the Memerator API in C#.

Getting Started

To install and use the SDK, follow the steps below.

Prerequisites

Memerator for C# depends on .NET Core version 2.1 or above, and requires NuGet package Newtonsoft.Json 12.0.3 or later.

Installing

As of now, you can download the .dll from the Actions tab.

  1. Go to here
  2. Click the latest (highest) workflow
  3. Click Memerator.API.dll to download the only artifact.

Usage

Here is some sample code.

To get an API Key, go to the API Authentication page

using System;
using Memerator.API;
using Memerator.API.Objects;

namespace TestApp
{
    class Program
    {
        static void Main(string[] args)
        {
            // Instantiate MemeratorAPI
            MemeratorAPI api = new MemeratorAPI("[your api key]");
            // Get meme "aaaaaaa"
            Meme meme = api.GetMeme("aaaaaaa");
            // Return caption
            Console.WriteLine("Caption for meme aaaaaaa: " + meme.Caption());

            // To access the API directly
            JObject data = JObject.Parse(API.get("some/route"));
            Console.WriteLine("Check out: " + data["response"].Value<string>());
        
            // Change Key
            api.SetToken("MyNewToken");
        }
    }
}

Built With

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

  • Chew - Initial work

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details