Submission for the Riot April 2016 api challenge, the
Riot2016Submission branch is for you while the master branch will be our on going effect to improve this website.
This is our submission for the April 2016 api challenge! We wanted to make an app that helps the community, no matter a player’s rank. We love playing around counters during champion select, so we created a tool to help us determine the best champion in our arsenal to pick.
Lol Personal Counters is a website that determines both popular and personal win rates. With this information, it helps you figure out which champion you already play (and do well with), that you should pick to counter your lane opponent. The website is simple to use and understand but provides huge insight! There are other sites that determine counter matchups, but none of these sites restrict their lists to champions we actively play. For example, if you don't own Karthus, it’s not helpful for you to find out that he is the best counter to Katarina. With our site however, a champion you do own, like Orianna, is a logical counter to show.
The biggest hurdle for this api challenge, from a technical standpoint, was to combine personal win rates of champion matchups (and getting enough data for it!) with third party website win rates. After creating the website, we were a little disappointed about champion diversity (there are a few champions who are played most often). We decided to keep personal win rates and third party win rates separate because we didn’t have a good algorithm to properly weigh both win rates. When we continue this project, we would rate personal win rates higher than third party ones. Third party win rates are biased because they are so heavily weighted by platinum+ player performance, which not everyone in the community can live up to.
In conclusion, we would like to thank Riot for giving us the opportunity to show off our skills and give back to the community we love. Thanks!
- Proper loading page when users first check a matchup. Please be patient!! We are getting your rank stats! (little hack is to just refresh the page after a few second and the win rates will be determined in the background)
- Proper algorithm to combine personal win rates and third party win rates
Setting up the technology
- Install golang by following these steps exaclty on the golang website
- Ensure you have
$GOPATHenvironment variable and that you can run
go getfrom the command line.
mkdir -p $GOPATH/src/github.com/yawhideto setup the workspace
- Clone the git repo by running
git clone https://github.com/yawhide/Lol-personal-counters.git %GOPATH/src/github.com/yawhide/Lol-personal-counters(must be inside the
%GOPATH/src/github.com/yawhide/Lol-personal-countersdirectory) and ensure you are on the
- Install postgres 9.5
- Please leave the port on 5432
- On windows you can download this installer, ensure you choose v9.5
- On ubuntu, you can follow this guide to setup postgres9.5: guide
- On mac, you can download Postgres.app
- Ensure postgres is running
psqlon the command line and it should start the command line version of postgres
\duand find out which role has superuser
- Copy the config.json.sample to config.json and edit the file
- Add the postgres
superuserusername/password into the config.json under the
- Add the riot api key and the champion.gg api key (the champion.gg api key will be provided in the notes on the application)
- cd to
go get github.com/tools/godep
- If you get an error talking about "error downloading dep (launchpad.net/go-xdg): exec "brz" blah blah blah
go get -u -insecure github.com/yawhide/go-lol
go run main.go api.go analytics.gofrom the github root folder
- If all goes well, the application starts with no errors, you should see
Server startedand you can navigate to
cmd-cto stop the server
- Navigate to
scripts/inside the github folder and run
go run data.go api.go analytics.go
- If you see a bunch of urls hitting champion.gg, that is good. We are getting the latest win rates for the current patch. wait until its done (it should exit)
- Now we are ready to go! run
cd ..to go back to the root directory and run
go install .
- Now finally run
$GOPATH/bin/Lol-personal-countersand navigate to
localhost:8080. Please play around and enjoy the app!
- If you experience any issues, please email me us at
firstname.lastname@example.org write down an app note on my application. Thanks!
If you are getting an error talking about some
brz command, try installing bazaar and adding it to your path
You may need to manually
go get these to make the app work, please run
go get then enter the github link below
start postgres on windows
"pg_ctl" -D datafolderpath -l log\logfile start
access postgres on ubuntu
sudo -i -u postgres