Code Monkey home page Code Monkey logo

hsapi's Introduction

Hearthstone API GoDoc Build Status Go Report Card

Golang Bindings for the hearthstoneapi.com API

Summary

Unoficial hearthstoneapi Go Client Library

Instalation

go get github.com/eefret/hsapi

Documentation

For the general api docs please see the Official Mashape Docs. For details on all the functionality on this library, see the GoDoc documentation.

Usage Example

import(
    "github.com/eefret/hsapi"
    "fmt"
)

  // Search Example
  func main() {
  	api := hsapi.NewHsAPI("tntkXJyM7EmshBgQYsXtCHHEX8Izp1uHrN1jsnTpw7tNCxEZIN") // Get yours in mashape
	api.Debug = true // Will print debug outputs
	config := hsapi.NewCardSearch("tirion fordring") // or any incomplete search
	config.Collectible = true // To narrow the search a little more
	resp, _ := api.Search(config)
	fmt.Println(resp[0].Name) // Tirion Fordring
	
	c := hsapi.NewCardImage(resp[0].CardID)
	c.Gold = true
	resp, _ := api.CardImage(c)
	f, _ := os.Create("Tirion_Fordring.gif")
	defer f.Close()
	f.Write(resp.Image) // Writing []byte into the file

	//Now featuring card sounds
	c2 := hs.NewCardSound("EX1_383", hs.PLAY)
    c2.Locale = hs.EsES
    c2.Extension = hs.MP3
    resp, _ := api.CardSound(c2)
	f, _ := os.Create("Tirion_Fordring_Play.mp3")
	defer f.Close()
	f.Write(resp.Sound) // Writing []byte into the file
  }

hsapi's People

Contributors

eefret avatar rmariuzzo avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rmariuzzo

hsapi's Issues

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.