Breaking api change

master
exsersewo 6 years ago
parent e42f98a471
commit 0e69535bff
  1. 50
      SysEx.Net/Client.cs
  2. 4
      SysEx.Net/SysEx.Net.csproj

@ -15,28 +15,28 @@ namespace SysEx.Net
random = new Random();
}
public async Task<string> GetLlamaAsync() =>
await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/get/llama.json"));
public async Task<string> v1LlamaAsync() =>
await v1AnimalAsync(new Uri("https://api.systemexit.co.uk/v1/llama.json"));
public async Task<string> GetSealAsync() =>
await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/get/seal.json"));
public async Task<string> v1SealAsync() =>
await v1AnimalAsync(new Uri("https://api.systemexit.co.uk/v1/seal.json"));
public async Task<string> GetDuckAsync() =>
await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/get/duck.json"));
public async Task<string> v1DuckAsync() =>
await v1AnimalAsync(new Uri("https://api.systemexit.co.uk/v1/duck.json"));
public async Task<string> GetSquirrelAsync() =>
await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/get/squirrel.json"));
public async Task<string> v1SquirrelAsync() =>
await v1AnimalAsync(new Uri("https://api.systemexit.co.uk/v1/squirrel.json"));
public async Task<string> GetLizardAsync() =>
await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/get/lizard.json"));
public async Task<string> v1LizardAsync() =>
await v1AnimalAsync(new Uri("https://api.systemexit.co.uk/v1/lizard.json"));
public async Task<string> GetMorphAsync() =>
await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/get/morphs.json"));
public async Task<string> v1MorphAsync() =>
await v1AnimalAsync(new Uri("https://api.systemexit.co.uk/v1/morphs.json"));
public async Task<string> GetSnakeAsync() =>
await GetAnimalAsync(new Uri("https://api.systemexit.co.uk/get/snake.json"));
public async Task<string> v1SnakeAsync() =>
await v1AnimalAsync(new Uri("https://api.systemexit.co.uk/v1/snake.json"));
async Task<string> GetAnimalAsync(Uri url)
async Task<string> v1AnimalAsync(Uri url)
{
var resp = await WebRequest.ReturnStringAsync(url);
var items = JsonConvert.DeserializeObject<List<Animal>>(resp);
@ -45,43 +45,43 @@ namespace SysEx.Net
return animal;
}
public async Task<string> GetRoastAsync()
public async Task<string> 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<List<Roasts>>(resp);
if (items == null) return null;
return items[random.Next(0, items.Count)].Roast;
}
public async Task<Joke> GetDadJokeAsync()
public async Task<Joke> 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<List<Joke>>(resp);
if (items == null) return null;
return items[random.Next(0, items.Count)];
}
public async Task<Joke> GetPickupLineAsync()
public async Task<Joke> 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<List<Joke>>(resp);
if (items == null) return null;
return items[random.Next(0, items.Count)];
}
public async Task<string> GetWeebActionGifAsync(GifType type)
public async Task<string> 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<string> GetWeebReactionGifAsync()
public async Task<string> v1WeebReactionGifAsync()
{
var resp = await WebRequest.ReturnStringAsync(new Uri("https://api.systemexit.co.uk/reactions/"));
return resp;
}
public async Task<string> GetLewdKitsuneAsync()
public async Task<string> 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<string> GetKitsuneAsync()
public async Task<string> v1KitsuneAsync()
{
var rawresp = await WebRequest.ReturnStringAsync(new Uri("https://kitsu.systemexit.co.uk/kitsune"));
dynamic item = JObject.Parse(rawresp);

@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>exsersewo</Authors>
<Company />
<PackageProjectUrl>https://github.com/exsersewo/SysEx.Net</PackageProjectUrl>
@ -15,7 +15,7 @@
<NeutralLanguage>en-GB</NeutralLanguage>
<RepositoryType>Library</RepositoryType>
<PackageLicenseUrl>https://github.com/exsersewo/SysEx.Net/blob/master/LICENSE</PackageLicenseUrl>
<Version>1.0.15</Version>
<Version>1.0.2</Version>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

Loading…
Cancel
Save