-
Notifications
You must be signed in to change notification settings - Fork 1
/
safe_holding.php
52 lines (45 loc) · 1.75 KB
/
safe_holding.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
include_once "sql.php";
include_once "config.php";
$journal = getFullWallet();
foreach ($journal as $row)
{
print_r($row);
$sql = "INSERT INTO `{$GLOBALS["TABLE"]}`(`date`,`refID`,`refTypeID`,`ownerName1`, `ownerID1`, `ownerName2`, `ownerID2`, `argName1`, `argID1`, `amount`, `balance`, `reason`, `owner1TypeID`, `owner2TypeID`) VALUES ('{$row["date"]}','{$row["refID"]}','{$row["refTypeID"]}','{$row["ownerName1"]}', '{$row["ownerID1"]}', '{$row["ownerName2"]}', '{$row["ownerID2"]}', '{$row["argName1"]}', '{$row["argID1"]}', '{$row["amount"]}', '{$row["balance"]}', '{$row["reason"]}', '{$row["owner1TypeID"]}', '{$row["owner2TypeID"]}')";
echo $sql;
var_dump(sql_write($sql));
}
function getFullWallet()
{
$journal = [];
$data = getWallet(999999999999999);
while ($data->row->count() > 0)
{
foreach ($data->row as $row){
array_push($journal,$row);
}
$data = getWallet($row["refID"]);
}
return $journal;
}
function getWallet($tranID){
$url = "https://api.eveonline.com/corp/WalletJournal.xml.aspx?keyID={$GLOBALS["API_KEYID"]}&vCode={$GLOBALS["API_vCode"]}&rowCount=2560&accountKey=1000&fromID=$tranID";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
// Set so curl_exec returns the result instead of outputting it.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Does not verify peer
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// Get the response and close the channel.
$headers = Array(
"Reddit: Shegox",
"IGN: Shegox Gabriel"
);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_ENCODING, "gzip");
$response = curl_exec($ch);
curl_close($ch);
$response = simplexml_load_string($response);
$response = $response->result->rowset;
return $response;
}