Card Hunter Win Rate Website

Discussion in 'Card Hunter General Chat' started by illkkill, Mar 11, 2014.

  1. illkkill

    illkkill Mushroom Warrior

    So a few days ago, I looked at the api.cardhunter.com which looks really cool, so I decided to make a website that calculates win rate based on what character you use, and maybe items too.
    Unfortunately, the character api and the items api both don't work!!!!!!!
    Now this website only calculates your win rate based on parameters in the battle api :(

    So here it is: http://cardhunter.x10.mx/
    Source Code: http://cardhunter.x10.mx/SourceCode

    I hope the website doesn't get removed because I'm using a free hosting service for it. It might be slow sometimes because of that, but it works pretty fast on my computer.

    Because I'm really new to mySQL, php, html, javascript, css, etc... my website is not very well polished (in fact, this is my 2nd website ever.... my first one only used html and javascript).
    If you feel like you can make the website better, feel free to download the source code and make a better version.

    The data pumping mechanism is based on Farb's battle-scraper and the cron job runs every minute.
    It basically just stores the data into the database.
    My data usage is already around 120 http requests per hour, which is almost at the http request limit. Good thing I only used the battle api. If I use another characters.api (which is 6 times the total battle size because it's 6 characters per battle), my data retrieval rate will never catch up people's playing rate so the website will be permanently outdated :(

    The html/css basically just lay out the website.
    The javascript lets the user send http requests to my server and does other cool stuff like adding/removing filters.
    Another internal php handles the http request and gets data from the database. (query.php)

    I didn't make good comments but I usually make my variables names easy to understand.

    If you have any questions regarding the website or the code, you can pm me.
     
  2. Jarmo

    Jarmo Snow Griffin

    Cool site, thanks for creating it!

    It took me a little bit to get that the players are listed as "player1" and "player2" but the winner is listed as "0" and "1" so player1 = 0 and player2 = 1. If you can somehow make this easier to understand quickly it would help the usability of the site.

    For example, you could have a column listing the winner's name or "win" / "loss" based on the username used in the query. So if I searched for "Jarmo", I'd see "win" for my wins and "loss" if the other player won.

    If that is too complicated, even replacing "0" with "player1" and "1" with "player2" would be very helpful. Let the site do the conversion work and not the user :).
     
  3. illkkill

    illkkill Mushroom Warrior

    Sure, that is a really good idea!!!
    I basically just print out the database code based on the cardhunter.api which has really weird syntax.
    I'll try converting it on the website rather than just displaying that result.
    Tell me if you have any more ideas! Thanks!
    I have homework to do these few days, but I'll try to update the site when I have time!
     
    Jayce and Jarmo like this.
  4. Megadestructo

    Megadestructo Shark Card

    Very cool illkkill!
     
    Pilgrim Bailey and illkkill like this.
  5. illkkill

    illkkill Mushroom Warrior

    Update: Now the website says Win when you win and Lose when you lose.
    It also change the color of the row to green if you win and red if you lose.
     
    Bandreus and Jarmo like this.
  6. Jarmo

    Jarmo Snow Griffin

    Thanks Illkkill, that's very clear to read now!
     
  7. illkkill

    illkkill Mushroom Warrior

    No problem ;)!! Tell me if you have any more suggestions!
     
  8. Vakaz

    Vakaz Guild Leader

    Hmm, looks like the site has been removed.
     

Share This Page