mc stats on website

Discussion in 'Spigot Plugin Development' started by plekz, Jan 6, 2020.

  1. I want to be able to display mc stats on a website, like baltop etc.
    Recently I've been learning RESTful web services with jersey, but I'm not sure what to exactly learn.
    Im trying to avoid using jQuery and store data in a database.

    So my question is: What do I need to learn to be able to display stats on a website?
  2. MrGeneralQ

    MrGeneralQ Previously qintinator

    Can't you embed the graph in your webpage? I don't think you need any REST integration for that. Altough I'm not experienced yet with mc stats. jQuery is not the way to go.
  3. but how would i communicate between the server and the website?
  4. MrGeneralQ

    MrGeneralQ Previously qintinator

    Your website would simply embed a an image or piece of html. The content will be managed on mcstats, not your website. I'm afraid I don't have much more information on that
  5. He does not mean or other web pages' minecraft stats, but top balance of minecraft players on his server and similar stuff.
  6. MrGeneralQ

    MrGeneralQ Previously qintinator

    Yeah, I think you are right. I was thinking about bStats actually :)
  7. bump.
    To clarify, I want to display like the money of a player on my own website, and im trying to avoid putting data in a database. I've learned some rest with jersey but I dont exactly know how to place that data in the html code.
  8. Realistically, you are going to have your server call your RESTful API with data and then store this data in a database of some file somewhere, then on you actual site you can load the values from the file or database onto the page, either before the page is sent to a users or via an Ajax request to fetch the required data after the page has loaded.

    You're trying to avoid databases, which in reality would be the best storage medium for this, as not only can you easily expand what you are storing, you can also query for specific data for use in analytics (should you want this).

    Personally, I would have the plugin either call a RESTful API on your webserver to interact with the database or directly interact with it in Java with something like HikariCP or another reliable and well known package. Then on the web-end you can either put values into the HTML and then send it to a viewer, or request data after the page has loaded via JavaSccript.