From d4985f26ddc7de303089da797c334054dece14f7 Mon Sep 17 00:00:00 2001 From: Kwoth Date: Thu, 1 Dec 2016 12:33:52 +0100 Subject: [PATCH] removed atf completely, closes #832 --- src/NadekoBot/Modules/NSFW/NSFW.cs | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/src/NadekoBot/Modules/NSFW/NSFW.cs b/src/NadekoBot/Modules/NSFW/NSFW.cs index 7d8f3f56..4c16efbb 100644 --- a/src/NadekoBot/Modules/NSFW/NSFW.cs +++ b/src/NadekoBot/Modules/NSFW/NSFW.cs @@ -68,8 +68,7 @@ namespace NadekoBot.Modules.NSFW var links = await Task.WhenAll(GetGelbooruImageLink(tag), GetDanbooruImageLink(tag), GetKonachanImageLink(tag), - GetYandereImageLink(tag), - GetATFbooruImageLink(tag)).ConfigureAwait(false); + GetYandereImageLink(tag)).ConfigureAwait(false); if (links.All(l => l == null)) { @@ -327,25 +326,5 @@ namespace NadekoBot.Modules.NSFW return "Error, do you have too many tags?"; } } - - public static async Task GetATFbooruImageLink(string tag) - { - var rng = new NadekoRandom(); - - var link = $"https://atfbooru.ninja/posts?" + - $"limit=100"; - if (!string.IsNullOrWhiteSpace(tag)) - link += $"&tags={tag.Replace(" ", "+")}"; - using (var http = new HttpClient()) - { - var webpage = await http.GetStringAsync(link).ConfigureAwait(false); - var matches = Regex.Matches(webpage, "data-file-url=\"(?.*?)\""); - - if (matches.Count == 0) - return null; - return $"https://atfbooru.ninja" + - $"{matches[rng.Next(0, matches.Count)].Groups["id"].Value}"; - } - } } }