Create a gist now

Instantly share code, notes, and snippets.

anonymous /EVECharacterSkillLookup
Created Feb 7, 2016

What would you like to do?
$eveBaseUrl = "https://api.eveonline.com/";
$eveSkillUrl = ($eveBaseUrl + "eve/SkillTree.xml.aspx")
$eveSkillDoc = New-Object System.Xml.XmlDocument
$eveSkillDoc.Load($eveSkillUrl)
$skillGroupDef = @{}
select-xml '//rowset[contains(@name,"skillGroups")]/row' $eveSkillDoc | %{
$skillGroupDef[$_.node.groupID] =$_.node.groupName
}
$skillDef = @{};
select-xml '//rowset[contains(@name,"skills")]/row' $eveSkillDoc | %{
$skill = New-Object System.Object
$skill | Add-Member -Name GroupID -Value $_.Node.groupID -MemberType NoteProperty
$skill | Add-Member -Name GroupName -Value $skillGroupDef.Get_Item($_.Node.groupID) -MemberType NoteProperty
$skill | Add-Member -Name TypeID -Value $_.Node.typeID -MemberType NoteProperty
$skill | Add-Member -Name Name -Value $_.Node.typeName -MemberType NoteProperty
($skillDef.Add( $_.Node.typeID,$skill))
}
$CharacterId = "Your Character ID obtained from profile picture";
$KeyId = "Your Key ID obtained from EVE API";
$APIKey = "Your API ID obtained from EVE API";
$eveCharacterSheetUrl = ($eveBaseUrl+"char/CharacterSheet.xml.aspx?CharacterID=$CharacterId&vCode=$APIKey&KeyID=$KeyId")
$eveCharacterSheetXmlDoc = New-Object System.Xml.XmlDocument
$eveCharacterSheetXmlDoc.Load($eveCharacterSheetUrl)
$characterSkills =@()
(select-xml '//rowset[contains(@name, "skills")]' $eveCharacterSheetXmlDoc).node.ChildNodes | %{
$characterSkill = New-Object System.Object
$characterSkill | Add-Member -Name SkillName -Value $characterSkillPoint.Name -MemberType NoteProperty
$characterSkillPoint = $skillDef.Get_Item($_.typeID)
$characterSkill | Add-Member -Name SkillGroupName -Value $characterSkillPoint.GroupName -MemberType NoteProperty
# $characterSkill | Add-Member -Name TypeID -Value $_.typeID -MemberType NoteProperty
$characterSkill | Add-Member -Name Level -Value $_.level -MemberType NoteProperty
# $characterSkill | Add-Member -Name SkillPoints -Value $_.skillpoints -MemberType NoteProperty
# $characterSkill | Add-Member -Name SkillGroupID -Value $characterSkillPoint.GroupID -MemberType NoteProperty
$characterSkills+= $characterSkill
}
$characterSkills
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment