diff --git a/src/main/java/org/jointheleague/discord_bot_example/Bot.java b/src/main/java/org/jointheleague/discord_bot_example/Bot.java index bf42e5a7..8e8caac6 100644 --- a/src/main/java/org/jointheleague/discord_bot_example/Bot.java +++ b/src/main/java/org/jointheleague/discord_bot_example/Bot.java @@ -104,9 +104,9 @@ public void connect(boolean printInvite) { api.addMessageCreateListener(mttt); helpListener.addHelpEmbed(mttt.getHelpEmbed()); - Greeter g = new Greeter(channelName); - api.addMessageCreateListener(g); - helpListener.addHelpEmbed(g.getHelpEmbed()); + //Greeter g = new Greeter(channelName); + //api.addMessageCreateListener(g); + //helpListener.addHelpEmbed(g.getHelpEmbed()); pythagcalc pythagCalc = new pythagcalc(channelName); api.addMessageCreateListener(pythagCalc); @@ -132,6 +132,14 @@ public void connect(boolean printInvite) { api.addMessageCreateListener(rps); helpListener.addHelpEmbed(rps.getHelpEmbed()); + AgeGuesser wapi = new AgeGuesser(channelName); + api.addMessageCreateListener(wapi); + helpListener.addHelpEmbed(wapi.getHelpEmbed()); + + RecipeGetter rg = new RecipeGetter(channelName); + api.addMessageCreateListener(rg); + helpListener.addHelpEmbed(rg.getHelpEmbed()); + //old way to add listeners api.addMessageCreateListener(helpListener); api.addMessageCreateListener(new MomBot(channelName)); diff --git a/src/main/java/org/jointheleague/modules/AgeGuesser.java b/src/main/java/org/jointheleague/modules/AgeGuesser.java new file mode 100644 index 00000000..0d6b5edd --- /dev/null +++ b/src/main/java/org/jointheleague/modules/AgeGuesser.java @@ -0,0 +1,68 @@ +package org.jointheleague.modules; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.ProtocolException; +import java.net.URL; + +import javax.json.Json; +import javax.json.JsonObject; +import javax.json.JsonReader; + +import org.javacord.api.event.message.MessageCreateEvent; +import org.jointheleague.modules.pojo.HelpEmbed; +import org.jointheleague.modules.pojo.apiExample.ApiExampleWrapper; +import org.jointheleague.pojo.age.Age; + +import com.google.gson.Gson; + +import net.aksingh.owmjapis.api.APIException; + +public class AgeGuesser extends CustomMessageCreateListener{ + + private static final String COMMAND = "!age"; + private final Gson gson = new Gson(); + + public AgeGuesser(String channelName) { + super(channelName); + helpEmbed = new HelpEmbed(COMMAND, "User inputs a name and the bot returns an estimated age"); + // TODO Auto-generated constructor stub + } + + @Override + public void handle(MessageCreateEvent event) throws APIException { + // TODO Auto-generated method stub + if(event.getMessageContent().contains(COMMAND)) { + + //remove the command so we are only left with the search term + String msg = event.getMessageContent().replaceAll(" ", "").replace(COMMAND, ""); + if (msg.equals("")) { + event.getChannel().sendMessage("Please put a word after the command"); + } + else { + event.getChannel().sendMessage("" + getAge(msg)); + } + } + } + + public int getAge(String name) { + String requestURL = "https://api.agify.io?name=" + name; + try { + URL url = new URL(requestURL); + HttpURLConnection con = (HttpURLConnection) url.openConnection(); + con.setRequestMethod("GET"); + JsonReader repoReader = Json.createReader(con.getInputStream()); + JsonObject userJSON = ((JsonObject) repoReader.read()); + Age age = gson.fromJson(userJSON.toString(), Age.class); + return age.getAge(); + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (ProtocolException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } + return 0; + } +} diff --git a/src/main/java/org/jointheleague/modules/RecipeGetter.java b/src/main/java/org/jointheleague/modules/RecipeGetter.java new file mode 100644 index 00000000..3845eef0 --- /dev/null +++ b/src/main/java/org/jointheleague/modules/RecipeGetter.java @@ -0,0 +1,141 @@ +package org.jointheleague.modules; + +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.ProtocolException; +import java.net.URL; +import java.util.List; + +import javax.json.Json; +import javax.json.JsonObject; +import javax.json.JsonReader; + +import org.javacord.api.event.message.MessageCreateEvent; +import org.jointheleague.modules.pojo.HelpEmbed; +import org.jointheleague.modules.pojo.Recipes.AnalyzedInstruction; +import org.jointheleague.modules.pojo.Recipes.Recipe; +import org.jointheleague.modules.pojo.Recipes.Recipe2; +import org.jointheleague.modules.pojo.Recipes.Result; +import org.jointheleague.modules.pojo.Recipes.Step; +import org.jointheleague.modules.pojo.apiExample.ApiExampleWrapper; +import org.jointheleague.modules.pojo.apiExample.Article; + +import com.google.gson.Gson; + +public class RecipeGetter extends CustomMessageCreateListener{ + private final String apiKey = "d5586ac37ada4f5fa9659784ce91e9a6"; + private static final String COMMAND = "!recipe"; + private final Gson gson = new Gson(); + + public RecipeGetter(String channelName) { + super(channelName); + helpEmbed = new HelpEmbed(COMMAND, "Example of using an API to get information from another service"); + + } + + @Override + public void handle(MessageCreateEvent event) { + if(event.getMessageContent().contains(COMMAND)) { + System.out.println("hi"); + + //remove the command so we are only left with the search term + String msg = event.getMessageContent().replaceAll(" ", "").replace(COMMAND, ""); + + if (msg.equals("")) { + event.getChannel().sendMessage("Please put a word after the command"); + } else { + String definition = getRecipe(msg); + event.getChannel().sendMessage(definition); + } + + } + } + + public String getRecipe(String topic) { + + //create the request URL (can be found in the documentation) + String requestURL = "https://api.spoonacular.com/recipes/complexSearch/?apiKey=" + + apiKey+"&query=" + + topic; + + try { + + //the following code will probably be the same for your feature + URL url = new URL(requestURL); + HttpURLConnection con = (HttpURLConnection) url.openConnection(); + con.setRequestMethod("GET"); + JsonReader repoReader = Json.createReader(con.getInputStream()); + JsonObject userJSON = ((JsonObject) repoReader.read()); + con.disconnect(); + + //turn the json response into a java object + //you will need to create a java class that represents the response in org.jointheleague.modules.pojo + //you can use a tools like Postman and jsonschema2pojo.com to help with that + + //you can use postman to make the request and receive a response, then take that and put it right into jsonschema2pojo.com + //If using jsonschema2pojo.com, select Target Langue = java, Source Type = JSON, Annotation Style = Gson + Recipe r = gson.fromJson(userJSON.toString(), Recipe.class); + + //get the first article (these are just java objects now) + //Article article = apiExampleWrapper.getArticles().get(0); + + //get the title of the article + //String articleTitle = article.getTitle(); + + //get the content of the article + //String articleContent = article.getContent(); + + //create the message + int id = r.getResults().get(0).getId(); + String requestURL2 = "https://api.spoonacular.com/recipes/"+ id + "/information?apiKey=" + + apiKey; + url = new URL(requestURL2); + con = (HttpURLConnection) url.openConnection(); + con.setRequestMethod("GET"); + repoReader = Json.createReader(con.getInputStream()); + userJSON = ((JsonObject) repoReader.read()); + con.disconnect(); + + Recipe2 instructions = gson.fromJson(userJSON.toString(), Recipe2.class); + + List steps = instructions.getAnalyzedInstructions().get(0).getSteps(); + String message = ""; + int stepCount = 1; + for (int i = 0; i < steps.size(); i++) { + message+=steps.get(i).getStep(); + } + System.out.println(instructions); + //send the message + String message2 = ""; + for (int i = 0; i < message.length(); i++) { + if(i==0) { + message2+=stepCount + ". "; + } + message2+=message.charAt(i); + if(message.charAt(i)=='.') { + message2+="\n\n"; + stepCount++; + if(i!=message.length()-1) { + message2+=stepCount + ". "; + } + } + } + return message2; + + + + + } catch (MalformedURLException e) { + e.printStackTrace(); + } catch (ProtocolException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } catch (IndexOutOfBoundsException e) { + e.printStackTrace(); + } + + return "No recipe found for the keyword: " + topic; + } +} diff --git a/src/main/java/org/jointheleague/modules/pojo/Recipes/AnalyzedInstruction.java b/src/main/java/org/jointheleague/modules/pojo/Recipes/AnalyzedInstruction.java new file mode 100644 index 00000000..e615423b --- /dev/null +++ b/src/main/java/org/jointheleague/modules/pojo/Recipes/AnalyzedInstruction.java @@ -0,0 +1,33 @@ + +package org.jointheleague.modules.pojo.Recipes; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class AnalyzedInstruction { + + @SerializedName("name") + @Expose + private String name; + @SerializedName("steps") + @Expose + private List steps = null; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public List getSteps() { + return steps; + } + + public void setSteps(List steps) { + this.steps = steps; + } + +} diff --git a/src/main/java/org/jointheleague/modules/pojo/Recipes/Equipment.java b/src/main/java/org/jointheleague/modules/pojo/Recipes/Equipment.java new file mode 100644 index 00000000..0c9dc359 --- /dev/null +++ b/src/main/java/org/jointheleague/modules/pojo/Recipes/Equipment.java @@ -0,0 +1,65 @@ + +package org.jointheleague.modules.pojo.Recipes; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Equipment { + + @SerializedName("id") + @Expose + private Integer id; + @SerializedName("name") + @Expose + private String name; + @SerializedName("localizedName") + @Expose + private String localizedName; + @SerializedName("image") + @Expose + private String image; + @SerializedName("temperature") + @Expose + private Temperature temperature; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getLocalizedName() { + return localizedName; + } + + public void setLocalizedName(String localizedName) { + this.localizedName = localizedName; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public Temperature getTemperature() { + return temperature; + } + + public void setTemperature(Temperature temperature) { + this.temperature = temperature; + } + +} diff --git a/src/main/java/org/jointheleague/modules/pojo/Recipes/ExtendedIngredient.java b/src/main/java/org/jointheleague/modules/pojo/Recipes/ExtendedIngredient.java new file mode 100644 index 00000000..4a0fbd38 --- /dev/null +++ b/src/main/java/org/jointheleague/modules/pojo/Recipes/ExtendedIngredient.java @@ -0,0 +1,154 @@ + +package org.jointheleague.modules.pojo.Recipes; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class ExtendedIngredient { + + @SerializedName("id") + @Expose + private Integer id; + @SerializedName("aisle") + @Expose + private String aisle; + @SerializedName("image") + @Expose + private String image; + @SerializedName("consistency") + @Expose + private String consistency; + @SerializedName("name") + @Expose + private String name; + @SerializedName("original") + @Expose + private String original; + @SerializedName("originalString") + @Expose + private String originalString; + @SerializedName("originalName") + @Expose + private String originalName; + @SerializedName("amount") + @Expose + private Double amount; + @SerializedName("unit") + @Expose + private String unit; + @SerializedName("meta") + @Expose + private List meta = null; + @SerializedName("metaInformation") + @Expose + private List metaInformation = null; + @SerializedName("measures") + @Expose + private Measures measures; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getAisle() { + return aisle; + } + + public void setAisle(String aisle) { + this.aisle = aisle; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getConsistency() { + return consistency; + } + + public void setConsistency(String consistency) { + this.consistency = consistency; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getOriginal() { + return original; + } + + public void setOriginal(String original) { + this.original = original; + } + + public String getOriginalString() { + return originalString; + } + + public void setOriginalString(String originalString) { + this.originalString = originalString; + } + + public String getOriginalName() { + return originalName; + } + + public void setOriginalName(String originalName) { + this.originalName = originalName; + } + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + + public List getMeta() { + return meta; + } + + public void setMeta(List meta) { + this.meta = meta; + } + + public List getMetaInformation() { + return metaInformation; + } + + public void setMetaInformation(List metaInformation) { + this.metaInformation = metaInformation; + } + + public Measures getMeasures() { + return measures; + } + + public void setMeasures(Measures measures) { + this.measures = measures; + } + +} diff --git a/src/main/java/org/jointheleague/modules/pojo/Recipes/Ingredient.java b/src/main/java/org/jointheleague/modules/pojo/Recipes/Ingredient.java new file mode 100644 index 00000000..90753980 --- /dev/null +++ b/src/main/java/org/jointheleague/modules/pojo/Recipes/Ingredient.java @@ -0,0 +1,54 @@ + +package org.jointheleague.modules.pojo.Recipes; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Ingredient { + + @SerializedName("id") + @Expose + private Integer id; + @SerializedName("name") + @Expose + private String name; + @SerializedName("localizedName") + @Expose + private String localizedName; + @SerializedName("image") + @Expose + private String image; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getLocalizedName() { + return localizedName; + } + + public void setLocalizedName(String localizedName) { + this.localizedName = localizedName; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + +} diff --git a/src/main/java/org/jointheleague/modules/pojo/Recipes/Length.java b/src/main/java/org/jointheleague/modules/pojo/Recipes/Length.java new file mode 100644 index 00000000..d2a4392b --- /dev/null +++ b/src/main/java/org/jointheleague/modules/pojo/Recipes/Length.java @@ -0,0 +1,32 @@ + +package org.jointheleague.modules.pojo.Recipes; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Length { + + @SerializedName("number") + @Expose + private Integer number; + @SerializedName("unit") + @Expose + private String unit; + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + +} diff --git a/src/main/java/org/jointheleague/modules/pojo/Recipes/Measures.java b/src/main/java/org/jointheleague/modules/pojo/Recipes/Measures.java new file mode 100644 index 00000000..886288f3 --- /dev/null +++ b/src/main/java/org/jointheleague/modules/pojo/Recipes/Measures.java @@ -0,0 +1,32 @@ + +package org.jointheleague.modules.pojo.Recipes; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Measures { + + @SerializedName("us") + @Expose + private Us us; + @SerializedName("metric") + @Expose + private Metric metric; + + public Us getUs() { + return us; + } + + public void setUs(Us us) { + this.us = us; + } + + public Metric getMetric() { + return metric; + } + + public void setMetric(Metric metric) { + this.metric = metric; + } + +} diff --git a/src/main/java/org/jointheleague/modules/pojo/Recipes/Metric.java b/src/main/java/org/jointheleague/modules/pojo/Recipes/Metric.java new file mode 100644 index 00000000..f5492e30 --- /dev/null +++ b/src/main/java/org/jointheleague/modules/pojo/Recipes/Metric.java @@ -0,0 +1,43 @@ + +package org.jointheleague.modules.pojo.Recipes; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Metric { + + @SerializedName("amount") + @Expose + private Double amount; + @SerializedName("unitShort") + @Expose + private String unitShort; + @SerializedName("unitLong") + @Expose + private String unitLong; + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public String getUnitShort() { + return unitShort; + } + + public void setUnitShort(String unitShort) { + this.unitShort = unitShort; + } + + public String getUnitLong() { + return unitLong; + } + + public void setUnitLong(String unitLong) { + this.unitLong = unitLong; + } + +} diff --git a/src/main/java/org/jointheleague/modules/pojo/Recipes/ProductMatch.java b/src/main/java/org/jointheleague/modules/pojo/Recipes/ProductMatch.java new file mode 100644 index 00000000..7a2f69f4 --- /dev/null +++ b/src/main/java/org/jointheleague/modules/pojo/Recipes/ProductMatch.java @@ -0,0 +1,109 @@ + +package org.jointheleague.modules.pojo.Recipes; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class ProductMatch { + + @SerializedName("id") + @Expose + private Integer id; + @SerializedName("title") + @Expose + private String title; + @SerializedName("description") + @Expose + private String description; + @SerializedName("price") + @Expose + private String price; + @SerializedName("imageUrl") + @Expose + private String imageUrl; + @SerializedName("averageRating") + @Expose + private Double averageRating; + @SerializedName("ratingCount") + @Expose + private Double ratingCount; + @SerializedName("score") + @Expose + private Double score; + @SerializedName("link") + @Expose + private String link; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getPrice() { + return price; + } + + public void setPrice(String price) { + this.price = price; + } + + public String getImageUrl() { + return imageUrl; + } + + public void setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + } + + public Double getAverageRating() { + return averageRating; + } + + public void setAverageRating(Double averageRating) { + this.averageRating = averageRating; + } + + public Double getRatingCount() { + return ratingCount; + } + + public void setRatingCount(Double ratingCount) { + this.ratingCount = ratingCount; + } + + public Double getScore() { + return score; + } + + public void setScore(Double score) { + this.score = score; + } + + public String getLink() { + return link; + } + + public void setLink(String link) { + this.link = link; + } + +} diff --git a/src/main/java/org/jointheleague/modules/pojo/Recipes/Recipe.java b/src/main/java/org/jointheleague/modules/pojo/Recipes/Recipe.java new file mode 100644 index 00000000..14fa8790 --- /dev/null +++ b/src/main/java/org/jointheleague/modules/pojo/Recipes/Recipe.java @@ -0,0 +1,55 @@ + +package org.jointheleague.modules.pojo.Recipes; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Recipe { + + @SerializedName("results") + @Expose + private List results = null; + @SerializedName("offset") + @Expose + private Integer offset; + @SerializedName("number") + @Expose + private Integer number; + @SerializedName("totalResults") + @Expose + private Integer totalResults; + + public List getResults() { + return results; + } + + public void setResults(List results) { + this.results = results; + } + + public Integer getOffset() { + return offset; + } + + public void setOffset(Integer offset) { + this.offset = offset; + } + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public Integer getTotalResults() { + return totalResults; + } + + public void setTotalResults(Integer totalResults) { + this.totalResults = totalResults; + } + +} diff --git a/src/main/java/org/jointheleague/modules/pojo/Recipes/Recipe2.java b/src/main/java/org/jointheleague/modules/pojo/Recipes/Recipe2.java new file mode 100644 index 00000000..5ff03fc3 --- /dev/null +++ b/src/main/java/org/jointheleague/modules/pojo/Recipes/Recipe2.java @@ -0,0 +1,407 @@ + +package org.jointheleague.modules.pojo.Recipes; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Recipe2 { + + @SerializedName("vegetarian") + @Expose + private Boolean vegetarian; + @SerializedName("vegan") + @Expose + private Boolean vegan; + @SerializedName("glutenFree") + @Expose + private Boolean glutenFree; + @SerializedName("dairyFree") + @Expose + private Boolean dairyFree; + @SerializedName("veryHealthy") + @Expose + private Boolean veryHealthy; + @SerializedName("cheap") + @Expose + private Boolean cheap; + @SerializedName("veryPopular") + @Expose + private Boolean veryPopular; + @SerializedName("sustainable") + @Expose + private Boolean sustainable; + @SerializedName("weightWatcherSmartPoints") + @Expose + private Integer weightWatcherSmartPoints; + @SerializedName("gaps") + @Expose + private String gaps; + @SerializedName("lowFodmap") + @Expose + private Boolean lowFodmap; + @SerializedName("aggregateLikes") + @Expose + private Integer aggregateLikes; + @SerializedName("spoonacularScore") + @Expose + private Double spoonacularScore; + @SerializedName("healthScore") + @Expose + private Double healthScore; + @SerializedName("creditsText") + @Expose + private String creditsText; + @SerializedName("license") + @Expose + private String license; + @SerializedName("sourceName") + @Expose + private String sourceName; + @SerializedName("pricePerServing") + @Expose + private Double pricePerServing; + @SerializedName("extendedIngredients") + @Expose + private List extendedIngredients = null; + @SerializedName("id") + @Expose + private Integer id; + @SerializedName("title") + @Expose + private String title; + @SerializedName("readyInMinutes") + @Expose + private Integer readyInMinutes; + @SerializedName("servings") + @Expose + private Integer servings; + @SerializedName("sourceUrl") + @Expose + private String sourceUrl; + @SerializedName("image") + @Expose + private String image; + @SerializedName("imageType") + @Expose + private String imageType; + @SerializedName("summary") + @Expose + private String summary; + @SerializedName("cuisines") + @Expose + private List cuisines = null; + @SerializedName("dishTypes") + @Expose + private List dishTypes = null; + @SerializedName("diets") + @Expose + private List diets = null; + @SerializedName("occasions") + @Expose + private List occasions = null; + @SerializedName("winePairing") + @Expose + private WinePairing winePairing; + @SerializedName("instructions") + @Expose + private String instructions; + @SerializedName("analyzedInstructions") + @Expose + private List analyzedInstructions = null; + @SerializedName("originalId") + @Expose + private Object originalId; + @SerializedName("spoonacularSourceUrl") + @Expose + private String spoonacularSourceUrl; + + public Boolean getVegetarian() { + return vegetarian; + } + + public void setVegetarian(Boolean vegetarian) { + this.vegetarian = vegetarian; + } + + public Boolean getVegan() { + return vegan; + } + + public void setVegan(Boolean vegan) { + this.vegan = vegan; + } + + public Boolean getGlutenFree() { + return glutenFree; + } + + public void setGlutenFree(Boolean glutenFree) { + this.glutenFree = glutenFree; + } + + public Boolean getDairyFree() { + return dairyFree; + } + + public void setDairyFree(Boolean dairyFree) { + this.dairyFree = dairyFree; + } + + public Boolean getVeryHealthy() { + return veryHealthy; + } + + public void setVeryHealthy(Boolean veryHealthy) { + this.veryHealthy = veryHealthy; + } + + public Boolean getCheap() { + return cheap; + } + + public void setCheap(Boolean cheap) { + this.cheap = cheap; + } + + public Boolean getVeryPopular() { + return veryPopular; + } + + public void setVeryPopular(Boolean veryPopular) { + this.veryPopular = veryPopular; + } + + public Boolean getSustainable() { + return sustainable; + } + + public void setSustainable(Boolean sustainable) { + this.sustainable = sustainable; + } + + public Integer getWeightWatcherSmartPoints() { + return weightWatcherSmartPoints; + } + + public void setWeightWatcherSmartPoints(Integer weightWatcherSmartPoints) { + this.weightWatcherSmartPoints = weightWatcherSmartPoints; + } + + public String getGaps() { + return gaps; + } + + public void setGaps(String gaps) { + this.gaps = gaps; + } + + public Boolean getLowFodmap() { + return lowFodmap; + } + + public void setLowFodmap(Boolean lowFodmap) { + this.lowFodmap = lowFodmap; + } + + public Integer getAggregateLikes() { + return aggregateLikes; + } + + public void setAggregateLikes(Integer aggregateLikes) { + this.aggregateLikes = aggregateLikes; + } + + public Double getSpoonacularScore() { + return spoonacularScore; + } + + public void setSpoonacularScore(Double spoonacularScore) { + this.spoonacularScore = spoonacularScore; + } + + public Double getHealthScore() { + return healthScore; + } + + public void setHealthScore(Double healthScore) { + this.healthScore = healthScore; + } + + public String getCreditsText() { + return creditsText; + } + + public void setCreditsText(String creditsText) { + this.creditsText = creditsText; + } + + public String getLicense() { + return license; + } + + public void setLicense(String license) { + this.license = license; + } + + public String getSourceName() { + return sourceName; + } + + public void setSourceName(String sourceName) { + this.sourceName = sourceName; + } + + public Double getPricePerServing() { + return pricePerServing; + } + + public void setPricePerServing(Double pricePerServing) { + this.pricePerServing = pricePerServing; + } + + public List getExtendedIngredients() { + return extendedIngredients; + } + + public void setExtendedIngredients(List extendedIngredients) { + this.extendedIngredients = extendedIngredients; + } + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public Integer getReadyInMinutes() { + return readyInMinutes; + } + + public void setReadyInMinutes(Integer readyInMinutes) { + this.readyInMinutes = readyInMinutes; + } + + public Integer getServings() { + return servings; + } + + public void setServings(Integer servings) { + this.servings = servings; + } + + public String getSourceUrl() { + return sourceUrl; + } + + public void setSourceUrl(String sourceUrl) { + this.sourceUrl = sourceUrl; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getImageType() { + return imageType; + } + + public void setImageType(String imageType) { + this.imageType = imageType; + } + + public String getSummary() { + return summary; + } + + public void setSummary(String summary) { + this.summary = summary; + } + + public List getCuisines() { + return cuisines; + } + + public void setCuisines(List cuisines) { + this.cuisines = cuisines; + } + + public List getDishTypes() { + return dishTypes; + } + + public void setDishTypes(List dishTypes) { + this.dishTypes = dishTypes; + } + + public List getDiets() { + return diets; + } + + public void setDiets(List diets) { + this.diets = diets; + } + + public List getOccasions() { + return occasions; + } + + public void setOccasions(List occasions) { + this.occasions = occasions; + } + + public WinePairing getWinePairing() { + return winePairing; + } + + public void setWinePairing(WinePairing winePairing) { + this.winePairing = winePairing; + } + + public String getInstructions() { + return instructions; + } + + public void setInstructions(String instructions) { + this.instructions = instructions; + } + + public List getAnalyzedInstructions() { + return analyzedInstructions; + } + + public void setAnalyzedInstructions(List analyzedInstructions) { + this.analyzedInstructions = analyzedInstructions; + } + + public Object getOriginalId() { + return originalId; + } + + public void setOriginalId(Object originalId) { + this.originalId = originalId; + } + + public String getSpoonacularSourceUrl() { + return spoonacularSourceUrl; + } + + public void setSpoonacularSourceUrl(String spoonacularSourceUrl) { + this.spoonacularSourceUrl = spoonacularSourceUrl; + } + +} diff --git a/src/main/java/org/jointheleague/modules/pojo/Recipes/Result.java b/src/main/java/org/jointheleague/modules/pojo/Recipes/Result.java new file mode 100644 index 00000000..756ebd70 --- /dev/null +++ b/src/main/java/org/jointheleague/modules/pojo/Recipes/Result.java @@ -0,0 +1,54 @@ + +package org.jointheleague.modules.pojo.Recipes; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Result { + + @SerializedName("id") + @Expose + private Integer id; + @SerializedName("title") + @Expose + private String title; + @SerializedName("image") + @Expose + private String image; + @SerializedName("imageType") + @Expose + private String imageType; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getImageType() { + return imageType; + } + + public void setImageType(String imageType) { + this.imageType = imageType; + } + +} diff --git a/src/main/java/org/jointheleague/modules/pojo/Recipes/Step.java b/src/main/java/org/jointheleague/modules/pojo/Recipes/Step.java new file mode 100644 index 00000000..149a18f6 --- /dev/null +++ b/src/main/java/org/jointheleague/modules/pojo/Recipes/Step.java @@ -0,0 +1,66 @@ + +package org.jointheleague.modules.pojo.Recipes; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Step { + + @SerializedName("number") + @Expose + private Integer number; + @SerializedName("step") + @Expose + private String step; + @SerializedName("ingredients") + @Expose + private List ingredients = null; + @SerializedName("equipment") + @Expose + private List equipment = null; + @SerializedName("length") + @Expose + private Length length; + + public Integer getNumber() { + return number; + } + + public void setNumber(Integer number) { + this.number = number; + } + + public String getStep() { + return step; + } + + public void setStep(String step) { + this.step = step; + } + + public List getIngredients() { + return ingredients; + } + + public void setIngredients(List ingredients) { + this.ingredients = ingredients; + } + + public List getEquipment() { + return equipment; + } + + public void setEquipment(List equipment) { + this.equipment = equipment; + } + + public Length getLength() { + return length; + } + + public void setLength(Length length) { + this.length = length; + } + +} diff --git a/src/main/java/org/jointheleague/modules/pojo/Recipes/Temperature.java b/src/main/java/org/jointheleague/modules/pojo/Recipes/Temperature.java new file mode 100644 index 00000000..b698a6ab --- /dev/null +++ b/src/main/java/org/jointheleague/modules/pojo/Recipes/Temperature.java @@ -0,0 +1,32 @@ + +package org.jointheleague.modules.pojo.Recipes; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Temperature { + + @SerializedName("number") + @Expose + private Double number; + @SerializedName("unit") + @Expose + private String unit; + + public Double getNumber() { + return number; + } + + public void setNumber(Double number) { + this.number = number; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + +} diff --git a/src/main/java/org/jointheleague/modules/pojo/Recipes/Us.java b/src/main/java/org/jointheleague/modules/pojo/Recipes/Us.java new file mode 100644 index 00000000..882e95a4 --- /dev/null +++ b/src/main/java/org/jointheleague/modules/pojo/Recipes/Us.java @@ -0,0 +1,43 @@ + +package org.jointheleague.modules.pojo.Recipes; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Us { + + @SerializedName("amount") + @Expose + private Double amount; + @SerializedName("unitShort") + @Expose + private String unitShort; + @SerializedName("unitLong") + @Expose + private String unitLong; + + public Double getAmount() { + return amount; + } + + public void setAmount(Double amount) { + this.amount = amount; + } + + public String getUnitShort() { + return unitShort; + } + + public void setUnitShort(String unitShort) { + this.unitShort = unitShort; + } + + public String getUnitLong() { + return unitLong; + } + + public void setUnitLong(String unitLong) { + this.unitLong = unitLong; + } + +} diff --git a/src/main/java/org/jointheleague/modules/pojo/Recipes/WinePairing.java b/src/main/java/org/jointheleague/modules/pojo/Recipes/WinePairing.java new file mode 100644 index 00000000..a5b83e25 --- /dev/null +++ b/src/main/java/org/jointheleague/modules/pojo/Recipes/WinePairing.java @@ -0,0 +1,44 @@ + +package org.jointheleague.modules.pojo.Recipes; + +import java.util.List; +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class WinePairing { + + @SerializedName("pairedWines") + @Expose + private List pairedWines = null; + @SerializedName("pairingText") + @Expose + private String pairingText; + @SerializedName("productMatches") + @Expose + private List productMatches = null; + + public List getPairedWines() { + return pairedWines; + } + + public void setPairedWines(List pairedWines) { + this.pairedWines = pairedWines; + } + + public String getPairingText() { + return pairingText; + } + + public void setPairingText(String pairingText) { + this.pairingText = pairingText; + } + + public List getProductMatches() { + return productMatches; + } + + public void setProductMatches(List productMatches) { + this.productMatches = productMatches; + } + +} diff --git a/src/main/java/org/jointheleague/pojo/age/Age.java b/src/main/java/org/jointheleague/pojo/age/Age.java new file mode 100644 index 00000000..7daeb64c --- /dev/null +++ b/src/main/java/org/jointheleague/pojo/age/Age.java @@ -0,0 +1,42 @@ +package org.jointheleague.pojo.age; + +import com.google.gson.annotations.Expose; +import com.google.gson.annotations.SerializedName; + +public class Age { + +@SerializedName("name") +@Expose +private String name; +@SerializedName("age") +@Expose +private Integer age; +@SerializedName("count") +@Expose +private Integer count; + +public String getName() { +return name; +} + +public void setName(String name) { +this.name = name; +} + +public Integer getAge() { +return age; +} + +public void setAge(Integer age) { +this.age = age; +} + +public Integer getCount() { +return count; +} + +public void setCount(Integer count) { +this.count = count; +} + +} \ No newline at end of file diff --git a/src/main/resources/config.json b/src/main/resources/config.json index 2de4a6ce..1de5b9fb 100644 --- a/src/main/resources/config.json +++ b/src/main/resources/config.json @@ -1,6 +1,6 @@ { - "channels": ["channel"], - "token": "token" + "channels": [""], + "token": "" }