These forums have been archived and are now read-only.
The new forums are live and can be found at https://forums.eveonline.com/
Simple script to automate with Powershell and MSSQL
$vCode = '&vCode=### YOUR VCODE HERE ###'$keyID = '?keyID=### YOUR KEYID HERE ###'$uri = 'https://api.eveonline.com/account/Characters.xml.aspx'$outfile = 'C:\temp\Characters.xml'$testpath = test-path $outfileif ($testpath -eq $False){ Invoke-RestMethod -Method Get $uri$keyID$vCode -OutFile C:\temp\Characters.xml [xml]$xml = (Get-Content "C:\temp\Characters.xml") }else{ [xml]$xml = (Get-Content "C:\temp\Characters.xml")}$currenttime = (Get-Date).ToShortTimeString()$cacheduntilinxml = Get-Date $xml.eveapi.cachedUntil$cacheduntil = $cacheduntilinxml.AddHours(1).ToShortTimeString()if($currenttime -gt $cacheduntil){ Invoke-RestMethod -Method Get $uri$keyID$vCode -OutFile C:\temp\Characters.xml}else{Write-Host "Do Nothing"}
USE YOUR_DATABASEGOINSERT INTO bulkdata(xml_characters)SELECT * FROM OPENROWSET(BULK 'C:\temp\Characters.xml', SINGLE_BLOB) AS xDECLARE @XML AS XML, @Doc AS INT, @SQL NVARCHAR (MAX)SELECT @XML = xml_characters FROM BulkdataEXEC sp_xml_preparedocument @Doc OUTPUT, @XMLINSERT INTO Characters (characterName, characterID, corporationName, corporationID, allianceID, allianceName, factionID, factionName)SELECT *FROM OPENXML(@Doc, 'eveapi/result/rowset/row')WITH (name [varchar](255) '@name',characterID [int] '@characterID',corporationName [varchar](255)'@corporationName',corporationID [int] '@corporationID',allianceID [int] '@allianceID',allianceName [varchar](255) '@allianceName',factionID [int] '@factionID',factionName [varchar](255) '@factionName')EXEC sp_xml_removedocument @DocGO