Created
January 4, 2015 02:00
-
-
Save capoferro/b531baafd49f5f3139c0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"github.com/capoferro/wow" | |
) | |
func main() { | |
client, _ := wow.NewApiClient("US", "") | |
reforged, _ := client.GetGuildWithFields("Runetotem", "Reforged", []string{"members"}) | |
for _, member := range reforged.Members { | |
var character *wow.Character | |
var err error | |
character, err = client.GetCharacterWithFields("Runetotem", member.Character.Name, []string{"progression"}) | |
if character == nil { | |
character, err = client.GetCharacterWithFields("Uther", member.Character.Name, []string{"progression"}) | |
} | |
if err != nil { | |
log.Println("Error fetching character:", err) | |
} | |
if character == nil || character.Progression == nil || character.Progression.Raids == nil { | |
continue | |
} | |
normalCounter := 0 | |
heroicCounter := 0 | |
for _, raid := range character.Progression.Raids { | |
if raid.Name != "Highmaul" { | |
continue | |
} | |
for _, boss := range raid.Bosses { | |
normalCounter += boss.NormalKills | |
heroicCounter += boss.HeroicKills | |
} | |
} | |
if normalCounter != 0 || heroicCounter != 0 { | |
fmt.Printf("%s: %dN, %dH\n", character.Name, normalCounter, heroicCounter) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment