Skip to content

Commit

Permalink
Removed duplicate key CURLOPT_URL in Request.php, added ids for apps,…
Browse files Browse the repository at this point in the history
… fixed inspect_link and image urls
  • Loading branch information
Allyans3 committed May 5, 2023
1 parent 75b77a3 commit 3e3e37e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
6 changes: 5 additions & 1 deletion src/Configs/Apps.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,9 @@ class Apps
{
const CSGO_ID = 730;

// const DOTA_2_ID = 570;
const DOTA_2_ID = 570;

const TF2_ID = 440;

const RUST_ID = 252490;
}
2 changes: 2 additions & 0 deletions src/Configs/Economic.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,7 @@ class Economic
45 => 'USD',
46 => 'USD',
47 => 'USD',
9000 => 'RMB',
9001 => 'NXP'
];
}
3 changes: 1 addition & 2 deletions src/Engine/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ private function makeSingleRequest(array $proxy = [], string $cookies = '', bool
$postOpts = [CURLOPT_POSTFIELDS => http_build_query($this->getFormData())];

curl_setopt_array($this->curl,
$this->defaultCurlOpts + EngineService::setProxyForSingle($proxy) + $curlOpts + $postOpts +[
$this->defaultCurlOpts + EngineService::setProxyForSingle($proxy) + $curlOpts + $postOpts + [
CURLOPT_CUSTOMREQUEST => $requestMethod,
CURLOPT_HTTPHEADER => self::mergeHeaders($this->getHeaders()),
CURLOPT_URL => $this->getUrl(),
CURLOPT_URL => (array_key_exists('url', $proxy)) ?
$proxy['url'].urlencode($this->getUrl()) : $this->getUrl(),
CURLOPT_HEADER => $detailed,
Expand Down
18 changes: 15 additions & 3 deletions src/Services/ResponseService.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,29 @@ public static function getAssetData($assets, $listingAssetData): array
'class_id' => $asset['classid'],
'instance_id' => $asset['instanceid'],
'market_hash_name' => $asset['market_hash_name'],
'icon_url' => $asset['icon_url'],
'icon_url_large' => $asset['icon_url_large'],
'icon_url' => array_key_exists('icon_url', $asset) ? $asset['icon_url'] : '',
'icon_url_large' => array_key_exists('icon_url_large', $asset) ? $asset['icon_url_large'] : '',
'stickers' => self::parseStickersFromDescription($asset['descriptions']),
'amount' => $asset['amount'],
'status' => $asset['status'],
'tradable' => $asset['tradable'],
'marketable' => $asset['marketable'],
'inspect_link' => str_replace("%assetid%", $asset['id'], $asset['actions'][0]['link'])
'inspect_link' => self::getInspectLink($asset)
];
}

/**
* @param $asset
* @return array|string|string[]
*/
private static function getInspectLink($asset)
{
if (array_key_exists('actions', $asset))
return str_replace("%assetid%", $asset['id'], $asset['actions'][0]['link']);

return '';
}

/**
* @param $description
* @return array|string|string[]
Expand Down

1 comment on commit 3e3e37e

@digitaltim-de
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GJ, can you contact me i get a partnership with you. bRi#5627

Please sign in to comment.