What is… jService.io?

Brett Cole
2 min readMay 14, 2018

--

Will Ferrell as Alex Trebek

So for a personal project of mine, I’m in the process of creating a Jeopardy game app. Just a little something to have some fun with family and friends. In the process of designing I found jService.io for the game’s questions. I haven’t really seen a blog on jService so I figured I’d write one.

So let’s get started with what is jService? You can find jService at this site. jService has over 156,800 questions from Jeopardy with their air dates. It provides a couple of ways to incorporate it into what you are working on. You can clone the download directly or theres a couple of included bots or you can include the jApi gem into your rails project. We will be working with the jApi gem. We aren’t bothering with cloning the rails repo and including it in our project which would work great but I’m also creating a rails api for the app with my own questions and I don’t feel like incorporating it. Gem always makes things easy.

Anybody that has worked with Ruby on Rails know to include a Gem you include it inside our Gemfile. So we include our japi gem and we are off to being asked questions. I’m still working on my structure of my app because I’m using a Rails backend with a React frontend. So I’ll be making requests to our Gem with the Insomnia app.

Inside Rails I created an api/v1/controllers file structure. So far I’m just using a CategoryController to show and test my work. Inside my controller I hav an index method.

class Api::V1::CategoryController < ApplicationController
def index
random_starting_point = rand(1..100)
category_clues = JAPI::Trebek
binding.pry
render json: category_clues.categories(:count => 6, :offset =>
random_starting_point), status: 200
end
end

I’m using a binding.pry inside my method so that I can test my results. Once I run a request from Insomnia I’m now inside my pry request. Here there is so many things I can do. Really I can check everything that jService offers from this one simple request. By simply assigning category_clues to JAPI::Trebek I can access the four different classes that it offers. By running commands from pry like category_clues.categories I can receive all the categories that the Gem offers. That’s not it I can also access all the categories with clues and random clues if I want from there.

This Gem is very specific to people who enjoy the Jeopardy but it’s built well and you can almost make your very own Jeopardy games out of it.

That’s it for this blog. Until next time maybe I’ll talk about including IBM watson inside my Jeopardy app. We will see. For now I’m outta here.

--

--

Brett Cole
Brett Cole

Written by Brett Cole

Full Stack Developer. Husband. Father.

No responses yet