@GET @Produces(MediaType.APPLICATION_JSON) @Path("whatdoesthefoxsay") public Response whatDoesTheFoxSay() { MircString quote = QuoteCache.INST.whatDoesTheFoxSay(); Response resp = null; if (quote.toString() != "") { resp = Response.ok(quote).build(); // TaskCache.INST.incrementTask(task); } else { resp = Response.noContent().build(); } return resp; }
@GET @Produces(MediaType.APPLICATION_JSON) @Path("oppa") public Response gangnamStyle() { MircString quote = QuoteCache.INST.gangnamStyle(); Response resp = null; if (quote.toString() != "") { resp = Response.ok(quote).build(); // TaskCache.INST.incrementTask(task); } else { resp = Response.noContent().build(); } return resp; }
@GET @Produces(MediaType.APPLICATION_JSON) @Path("stats/{duration}") public Response stats(@PathParam("duration") String duration) { MircString quote = QuoteCache.INST.stats(duration); Response resp = null; if (quote.toString() != "") { resp = Response.ok(quote).build(); // TaskCache.INST.incrementTask(task); } else { resp = Response.noContent().build(); } return resp; }
@GET @Produces(MediaType.APPLICATION_JSON) @Path("reddit/{subreddit}") public Response reddit(@PathParam("subreddit") String subreddit) { System.out.println("subreddit string is: " + subreddit); MircString quote = QuoteCache.INST.reddit(subreddit); Response resp = null; if (quote.toString() != "") { resp = Response.ok(quote).build(); // TaskCache.INST.incrementTask(task); } else { resp = Response.noContent().build(); } return resp; }