public FunModule(RuntimeModule m) { ImageboardProviderPool.AddProvider(new ImageboardProvider <E621Post>(new ImageboardConfigurations { QueryKey = "http://e621.net/post/index.json?limit=1&tags=", ExplicitTag = "rating:e", QuestionableTag = "rating:q", SafeTag = "rating:s", NetUseCredentials = true, NetHeaders = new List <string>() { "User-Agent: Other" } })); ImageboardProviderPool.AddProvider(new ImageboardProvider <GelbooruPost>("http://gelbooru.com/index.php?page=dapi&s=post&q=index&json=1&tags=")); ImageboardProviderPool.AddProvider(new ImageboardProvider <SafebooruPost>("https://safebooru.org/index.php?page=dapi&s=post&q=index&json=1&tags=")); ImageboardProviderPool.AddProvider(new ImageboardProvider <Rule34Post>("http://rule34.xxx/index.php?page=dapi&s=post&q=index&json=1&tags=")); ImageboardProviderPool.AddProvider(new ImageboardProvider <KonachanPost>("https://konachan.com/post.json?tags=")); ImageboardProviderPool.AddProvider(new ImageboardProvider <YanderePost>("https://yande.re/post.json?tags=")); }
public FunModule(Module m, Bot b) { ImageboardProviderPool.AddProvider(new ImageboardProvider <E621Post>(new ImageboardConfigurations { QueryKey = new Uri("http://e621.net/post/index.json?tags="), ExplicitTag = "rating:e", QuestionableTag = "rating:q", SafeTag = "rating:s", NetUseCredentials = true, NetHeaders = new List <Tuple <string, string> >() { new Tuple <string, string>("User-Agent", "Other"), }, BlacklistedTags = { "loli", "shota", } })); ImageboardProviderPool.AddProvider(new ImageboardProvider <DanbooruPost>(new ImageboardConfigurations { QueryKey = new Uri("https://danbooru.donmai.us/posts.json?tags="), ExplicitTag = "rating:e", QuestionableTag = "rating:q", SafeTag = "rating:s", NetUseCredentials = true, NetHeaders = { new Tuple <string, string>("Authorization", $"Basic {Convert.ToBase64String(Encoding.UTF8.GetBytes(Global.Config.DanbooruCredentials))}"), }, BlacklistedTags = { "loli", "shota" } })); ImageboardProviderPool.AddProvider(new ImageboardProvider <GelbooruPost>(new ImageboardConfigurations { QueryKey = new Uri("http://gelbooru.com/index.php?page=dapi&s=post&q=index&json=1&tags="), BlacklistedTags = { "loli", "shota", } })); ImageboardProviderPool.AddProvider(new ImageboardProvider <SafebooruPost>(new ImageboardConfigurations { QueryKey = new Uri("https://safebooru.org/index.php?page=dapi&s=post&q=index&json=1&tags="), BlacklistedTags = { "loli", "shota", } })); ImageboardProviderPool.AddProvider(new ImageboardProvider <Rule34Post>(new ImageboardConfigurations { QueryKey = new Uri("http://rule34.xxx/index.php?page=dapi&s=post&q=index&json=1&tags="), BlacklistedTags = { "loli", "shota", } })); ImageboardProviderPool.AddProvider(new ImageboardProvider <KonachanPost>(new ImageboardConfigurations { QueryKey = new Uri("https://konachan.com/post.json?tags="), BlacklistedTags = { "loli", "shota", } })); ImageboardProviderPool.AddProvider(new ImageboardProvider <YanderePost>(new ImageboardConfigurations { QueryKey = new Uri("https://yande.re/post.json?tags="), BlacklistedTags = { "loli", "shota", } })); }
public NsfwModule(Config config) { ImageboardProviderPool.AddProvider <E621Post>(new ImageboardProvider( new ImageboardConfigurations { QueryKey = new Uri("http://e621.net/post/index.json?tags="), ExplicitTag = "rating:e", QuestionableTag = "rating:q", SafeTag = "rating:s", NetUseCredentials = true, NetHeaders = new List <Tuple <string, string> >() { new Tuple <string, string>("User-Agent", "MikiBot"), }, BlacklistedTags = { "loli", "shota", "gore" }, mapper = content => MikiRandom.Of( JsonConvert.DeserializeObject <List <E621Post> >(content)) })); ImageboardProviderPool.AddProvider <DanbooruPost>(new ImageboardProvider( new ImageboardConfigurations { QueryKey = new Uri("https://danbooru.donmai.us/posts.json?tags="), ExplicitTag = "rating:e", QuestionableTag = "rating:q", SafeTag = "rating:s", NetUseCredentials = true, NetHeaders = { new Tuple <string, string>( "Authorization", $"Basic {Convert.ToBase64String(Encoding.UTF8.GetBytes(config.OptionalValues?.DanbooruApiKey ?? ""))}"), }, BlacklistedTags = { "loli", "shota", "gore" }, mapper = content => MikiRandom.Of( JsonConvert.DeserializeObject <List <DanbooruPost> >(content)) })); ImageboardProviderPool.AddProvider <GelbooruPost>(new ImageboardProvider( new ImageboardConfigurations { QueryKey = new Uri( "http://gelbooru.com/index.php?page=dapi&s=post&q=index&json=1&tags="), BlacklistedTags = { "loli", "shota", "gore" }, mapper = content => MikiRandom.Of( JsonConvert.DeserializeObject <List <GelbooruPost> >(content)) })); ImageboardProviderPool.AddProvider <SafebooruPost>(new ImageboardProvider( new ImageboardConfigurations { QueryKey = new Uri( "https://safebooru.org/index.php?page=dapi&s=post&q=index&json=1&tags="), BlacklistedTags = { "loli", "shota", "gore" }, mapper = content => MikiRandom.Of( JsonConvert.DeserializeObject <List <SafebooruPost> >(content)) })); ImageboardProviderPool.AddProvider <Rule34Post>(new ImageboardProvider( new ImageboardConfigurations { QueryKey = new Uri( "http://rule34.xxx/index.php?page=dapi&s=post&q=index&json=1&tags="), BlacklistedTags = { "loli", "shota", "gore" }, mapper = content => MikiRandom.Of( JsonConvert.DeserializeObject <List <Rule34Post> >(content)) })); ImageboardProviderPool.AddProvider <KonachanPost>(new ImageboardProvider( new ImageboardConfigurations { QueryKey = new Uri("https://konachan.com/post.json?tags="), BlacklistedTags = { "loli", "shota", }, mapper = content => MikiRandom.Of( JsonConvert.DeserializeObject <List <KonachanPost> >(content)) })); ImageboardProviderPool.AddProvider <YanderePost>(new ImageboardProvider( new ImageboardConfigurations { QueryKey = new Uri("https://yande.re/post.json?api_version=2&tags="), BlacklistedTags = { "loli", "shota", }, mapper = content => MikiRandom.Of( JsonConvert.DeserializeObject <YandereResponse>(content).Posts) })); }