GithubHelp home page GithubHelp logo

rmpacheco / ovrstat Goto Github PK

View Code? Open in Web Editor NEW

This project forked from s32x/ovrstat

0.0 1.0 0.0 810 KB

:video_game: A Fast and Detailed Unofficial Overwatch Stats API written in Go

Home Page: https://ovrstat.com

Dockerfile 0.47% Makefile 0.71% Shell 1.84% Go 73.01% CSS 3.63% JavaScript 2.26% HTML 18.08%

ovrstat's Introduction

ovrstat

GoDoc

ovrstat is a simple web scraper for the Overwatch stats site that parses and serves the data retrieved as JSON. Included is the go package used to scrape the info for usage in any go binary.

Note: This is a single endpoint web-scraping API that takes the full payload of information that we retrieve from Blizzard and passes it through to you in a single response. Things like caching and splitting data across multiple responses could likely improve performance, but in pursuit of keeping things simple, ovrstat does not implement them.

Running with Docker

docker run -p 8080:8080 starboy/ovrstat

Installing

go get github.com/starboy/ovrstat/ovrstat

Usage

You have two options for using the API:

  • Import the child dependency used in this API and use the API we host on Heroku
  • Host your own Ovrstat API using the public docker image starboy/ovrstat.

Below is an example of using the REST endpoint (note: CASE matters for the username/tag):

https://ovrstat.com/stats/pc/us/Viz-1213
https://ovrstat.com/stats/xbl/Lt%20Evolution
https://ovrstat.com/stats/psn/TayuyaBreast

And here is an example of using the included go library:

player, _ := ovrstat.PCStats("us", "Viz-1213")
player2, _ := ovrstat.ConsoleStats(ovrstat.PlatformXBL, "Lt%20Evolution")
player3, _ := ovrstat.ConsoleStats(ovrstat.PlatformPSN, "TayuyaBreast")

Both above examples should return to you a PlayerStats struct containing detailed statistics for the specified Overwatch player.

Full Go example

package main

import (
	"log"

	"github.com/starboy/ovrstat/ovrstat"
)

func main() {
	log.Println(ovrstat.PCStats("us", "Viz-1213"))
	log.Println(ovrstat.ConsoleStats(ovrstat.PlatformXBL, "Lt%20Evolution"))
	log.Println(ovrstat.ConsoleStats(ovrstat.PlatformPSN, "TayuyaBreast"))
}

Disclaimer

ovrstat isn’t endorsed by Blizzard and doesn’t reflect the views or opinions of Blizzard or anyone officially involved in producing or managing Overwatch. Overwatch and Blizzard are trademarks or registered trademarks of Blizzard Entertainment, Inc. Overwatch © Blizzard Entertainment, Inc.

The MIT License (MIT)

Copyright © 2018 Steven Wolfe

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

ovrstat's People

Contributors

s32x avatar savely-krasovsky avatar tystuyfzand avatar hecodes2much avatar mxygem avatar ordepdev avatar

Watchers

Román M. Pacheco 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.