-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa00e6b
commit 4e23e31
Showing
9 changed files
with
260 additions
and
33 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package org.hentaibot.dtos; | ||
|
||
public class WaifuDto { | ||
private String url; | ||
|
||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
public void setUrl(String url) { | ||
this.url = url; | ||
} | ||
@Override | ||
public String toString() { | ||
return "File url: " + url; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
src/main/java/org/hentaibot/network/AnimeWaifuQueries.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.hentaibot.network; | ||
|
||
import org.hentaibot.dtos.WaifuDto; | ||
import retrofit2.Call; | ||
import retrofit2.http.GET; | ||
import retrofit2.http.Path; | ||
import retrofit2.http.Query; | ||
|
||
import java.util.List; | ||
import java.util.Random; | ||
|
||
public interface AnimeWaifuQueries { | ||
|
||
Random random = new Random(); | ||
//String[] categories = new String[]{"waifu", "neko", "shinobu", "megumin", "bully", "cuddle", "cry", "hug", "awoo", "kiss", "lick", "pat", "smug", "bonk", "yeet", "blush", "smile", "wave", "highfive", "handhold", "nom", "bite", "glomp", "slap", "kill", "kick", "happy", "wink", "poke", "dance", "cringe"}; | ||
static String urlCategory = "waifu"; | ||
static String urlForm = "/sfw/"; //+ urlCategory; | ||
@GET("/sfw/{category}") | ||
Call<WaifuDto> getSFW( | ||
|
||
@Path("category") String category | ||
|
||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.hentaibot.network; | ||
|
||
import retrofit2.Retrofit; | ||
import retrofit2.converter.gson.GsonConverterFactory; | ||
|
||
public class ClientNSFW { | ||
|
||
private static Retrofit clientNWaifu = null; | ||
|
||
private static final String UrlNclient = "https://api.waifu.pics"; | ||
|
||
public HentaiWaifuQueries getNSFWClient() | ||
{ | ||
if(clientNWaifu == null) | ||
{ | ||
clientNWaifu = new Retrofit.Builder().baseUrl(UrlNclient).addConverterFactory(GsonConverterFactory.create()).build(); | ||
} | ||
return clientNWaifu.create(HentaiWaifuQueries.class); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.hentaibot.network; | ||
|
||
import retrofit2.Retrofit; | ||
import retrofit2.converter.gson.GsonConverterFactory; | ||
|
||
public class ClientSFW { | ||
|
||
private static Retrofit clientWaifu = null; | ||
|
||
private static final String UrlClient = "https://api.waifu.pics/"; | ||
|
||
public static AnimeWaifuQueries getSfwClient() | ||
{ | ||
if (clientWaifu == null) | ||
{ | ||
clientWaifu = new Retrofit.Builder().baseUrl(UrlClient).addConverterFactory(GsonConverterFactory.create()).build(); | ||
} | ||
return clientWaifu.create(AnimeWaifuQueries.class); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/org/hentaibot/network/HentaiWaifuQueries.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package org.hentaibot.network; | ||
|
||
import org.hentaibot.dtos.WaifuDto; | ||
import retrofit2.Call; | ||
import retrofit2.http.GET; | ||
import retrofit2.http.Query; | ||
|
||
import java.util.List; | ||
|
||
public interface HentaiWaifuQueries { | ||
|
||
@GET("/nsfw/") | ||
Call<List<WaifuDto>> getNSFW( | ||
@Query("category") String category | ||
); | ||
|
||
|
||
|
||
|
||
} |