From 0e69535bff898713b8d6372d76399f3a7b460eb4 Mon Sep 17 00:00:00 2001 From: exsersewo Date: Sun, 12 Aug 2018 19:08:25 +0100 Subject: [PATCH] Breaking api change --- SysEx.Net/Client.cs | 50 +++++++++++++++++++------------------- SysEx.Net/SysEx.Net.csproj | 4 +-- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/SysEx.Net/Client.cs b/SysEx.Net/Client.cs index ab991fb..ca83e81 100644 --- a/SysEx.Net/Client.cs +++ b/SysEx.Net/Client.cs @@ -15,28 +15,28 @@ namespace SysEx.Net random = new Random(); } - public async Task GetLlamaAsync() => - await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/get/llama.json")); + public async Task v1LlamaAsync() => + await v1AnimalAsync(new Uri("https://api.systemexit.co.uk/v1/llama.json")); - public async Task GetSealAsync() => - await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/get/seal.json")); + public async Task v1SealAsync() => + await v1AnimalAsync(new Uri("https://api.systemexit.co.uk/v1/seal.json")); - public async Task GetDuckAsync() => - await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/get/duck.json")); + public async Task v1DuckAsync() => + await v1AnimalAsync(new Uri("https://api.systemexit.co.uk/v1/duck.json")); - public async Task GetSquirrelAsync() => - await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/get/squirrel.json")); + public async Task v1SquirrelAsync() => + await v1AnimalAsync(new Uri("https://api.systemexit.co.uk/v1/squirrel.json")); - public async Task GetLizardAsync() => - await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/get/lizard.json")); + public async Task v1LizardAsync() => + await v1AnimalAsync(new Uri("https://api.systemexit.co.uk/v1/lizard.json")); - public async Task GetMorphAsync() => - await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/get/morphs.json")); + public async Task v1MorphAsync() => + await v1AnimalAsync(new Uri("https://api.systemexit.co.uk/v1/morphs.json")); - public async Task GetSnakeAsync() => - await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/get/snake.json")); + public async Task v1SnakeAsync() => + await v1AnimalAsync(new Uri("https://api.systemexit.co.uk/v1/snake.json")); - async Task GetAnimalAsync(Uri url) + async Task v1AnimalAsync(Uri url) { var resp = await WebRequest.ReturnStringAsync(url); var items = JsonConvert.DeserializeObject>(resp); @@ -45,43 +45,43 @@ namespace SysEx.Net return animal; } - public async Task GetRoastAsync() + public async Task v1RoastAsync() { - var resp = await WebRequest.ReturnStringAsync(new Uri("https://api.systemexit.co.uk/get/roasts.json")); + var resp = await WebRequest.ReturnStringAsync(new Uri("https://api.systemexit.co.uk/v1/roasts.json")); var items = JsonConvert.DeserializeObject>(resp); if (items == null) return null; return items[random.Next(0, items.Count)].Roast; } - public async Task GetDadJokeAsync() + public async Task v1DadJokeAsync() { - var resp = await WebRequest.ReturnStringAsync(new Uri("https://api.systemexit.co.uk/get/dadjokes.json")); + var resp = await WebRequest.ReturnStringAsync(new Uri("https://api.systemexit.co.uk/v1/dadjokes.json")); var items = JsonConvert.DeserializeObject>(resp); if (items == null) return null; return items[random.Next(0, items.Count)]; } - public async Task GetPickupLineAsync() + public async Task v1PickupLineAsync() { - var resp = await WebRequest.ReturnStringAsync(new Uri("https://api.systemexit.co.uk/get/pickuplines.json")); + var resp = await WebRequest.ReturnStringAsync(new Uri("https://api.systemexit.co.uk/v1/pickuplines.json")); var items = JsonConvert.DeserializeObject>(resp); if (items == null) return null; return items[random.Next(0, items.Count)]; } - public async Task GetWeebActionGifAsync(GifType type) + public async Task v1WeebActionGifAsync(GifType type) { var resp = await WebRequest.ReturnStringAsync(new Uri("https://api.systemexit.co.uk/actions/?action=" + type.ToString().ToLowerInvariant())); return resp; } - public async Task GetWeebReactionGifAsync() + public async Task v1WeebReactionGifAsync() { var resp = await WebRequest.ReturnStringAsync(new Uri("https://api.systemexit.co.uk/reactions/")); return resp; } - public async Task GetLewdKitsuneAsync() + public async Task v1LewdKitsuneAsync() { var rawresp = await WebRequest.ReturnStringAsync(new Uri("https://kitsu.systemexit.co.uk/lewd")); dynamic item = JObject.Parse(rawresp); @@ -89,7 +89,7 @@ namespace SysEx.Net if (img == null) return null; return img; } - public async Task GetKitsuneAsync() + public async Task v1KitsuneAsync() { var rawresp = await WebRequest.ReturnStringAsync(new Uri("https://kitsu.systemexit.co.uk/kitsune")); dynamic item = JObject.Parse(rawresp); diff --git a/SysEx.Net/SysEx.Net.csproj b/SysEx.Net/SysEx.Net.csproj index 5af1207..286128f 100644 --- a/SysEx.Net/SysEx.Net.csproj +++ b/SysEx.Net/SysEx.Net.csproj @@ -2,7 +2,7 @@ netstandard2.0 - false + true exsersewo https://github.com/exsersewo/SysEx.Net @@ -15,7 +15,7 @@ en-GB Library https://github.com/exsersewo/SysEx.Net/blob/master/LICENSE - 1.0.15 + 1.0.2