Code Monkey home page Code Monkey logo

gaikaitest's Introduction

GaikaiTest Project

FACTS ABOUT THE PROJECT

Technologies used : Java7, Gradle, Tomcat, Jersey, Servlets, Jsoup, Java Threading Objective : To display the top games using REST service web scraped from metacritic website. Please refer the PDF document to get idea of objective. Explanation : I have used threading and jsoup parse to extract the top games from the metacritic website. Once the web app starts running on tomcat server, it makes a request to the metacritic website using jsoup library using a thread in the servlet web listner. I have kept a fixed refresh interval where I make requests to the metacritic website to fetch the top games using the above process. I store the top games and ratings information in the static member of a class. When the rest services call is made by the browser, I simply use the data in the static memeber of that class to return the expected content. This way I always get the latest content from the metacritic website as well as I do not have to keep making requests each time to the metacritic website to fetch the data each time the rest service is called.

OBJECTIVES TO BE ACHIEVED :

  1. Method : GameFetchTask.scrapWebData()
  2. RESTful Services : GameRestService.getTopGames() GameRestService.getGameInfo()

RUNNING THE PROJECT This Java project is build using Gradle. Gradle can be downloaded from : http://www.gradle.org/

Once you have gradle installed on your OS, you can navigate inside the project and run this command from command line

 gradle tomcatRunWar

It will run the project on tomcat server.

After this you can navigate to this URL on any rest client like

Postman : https://chrome.google.com/webstore/detail/postman-rest-client/fdmmgilgnpjigdojojpjoooidkmcomcm?hl=en

Now since the rest services are running on the tomcat server, navigate to this URL to get the top games:

http://localhost:8080/GaikaiTest/rest/top/games It will give something like this as an output. [ { "title": "XCOM: Enemy Within", “score”: 88 }, { "title": "Assasin’s Creed IV: Black Flag", “score”: 88 } … etc ... ]

In case you want to find score for a top game then just append the game title to the Rest API URL. For example, navigate to this URL:
http://localhost:8080/GaikaiTest/rest/top/games/Gran%20Turismo%206 It will give something like this as an output.

{ "title": "Gran Turismo 6", "score": 81 }

gaikaitest's People

Contributors

anujku avatar

Stargazers

 avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.