Hacktoberfest: Week 4

Jagmeet Bhamber
2 min readOct 29, 2018

--

Hacktoberfest continues!

Introduction

This week I made my 4th of 5 pull requests for Hacktoberfest. Last week I worked on angular/material, and this time I decided to return to something familiar and contributed to redditdota/match-tracker.

This is very much related to my first pull request in redditdota/subredditcss, where I added logo images as well as CSS to be able to use those images.

The Issue

There is a Python bot that is used to provide live updates of ongoing tournament games. It accesses the game’s API to pull data about an ongoing match, and converts that data into a readable table. Here is an example post. All of the tables that show the scoreboard are bot-generated.

The game’s API does not give team names, but instead team IDs. So we must add a list of IDs for each team that has a logo available for use. Since I added new teams in my Week 1 pull request, this time I added those teams’ IDs to this bot’s list. Here is the issue I created.

Pull Request

This problem was fairly easy to resolve. I already knew how to find the team IDs. I used a community-made wiki site called Liquipedia that contains info related to Dota 2’s tournament scene. Each team’s page contains a “Links” section containing social media links as well as links to other fan sites that provide stats and other data. What I had to do was:

  1. Find a team on the wiki page (example)
  2. Open that team’s dotabuff page (example)
  3. Grab the ID from the url.
    - In this case the url was https://www.dotabuff.com/esports/teams/6214538-forward-gaming
    - the 6214538 was the ID
  4. Add it to the teams.py file in the repo alongside their name.

This was relatively easy to do and I was done in about 15 minutes. I submitted my pull request which was merged shortly after.

Conclusion

This was a very simple PR compared to most of the others I had done. I have a few days left for my final pull request to complete my assignment and earn a Hacktoberfest t-shirt. See you next time!

--

--