Jump to content

samcadek

New Members
  • Posts

    6
  • Joined

  • Last visited

samcadek's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. "{"sku":"730;6","buyHalfScrap":1,"buyKeys":0,"buyKeyHalfScrap":1238,"sellHalfScrap":2,"sellKeys":0,"sellKeyHalfScrap":1240,"createdAt":"2021-10-12T00:51:43.597Z","updatedAt":"2022-04-04T19:01:57.111Z"}"
  2. foreach ($inventories['rgDescriptions'] as $key => $description){ $samik = $description['app_data']; $url[] = "https://api2.prices.tf/prices/".$samik["def_index"]."%3B".$samik["quality"]; } $curl = curl_init($url);curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $headers = array( "accept: application/json", "Authorization: Bearer " .$value. " ",); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); //for debug only!curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $resp = curl_exec($curl);curl_close($curl); //var_dump($resp); I need foreach for the url and then use the data outside of the foreach in curl
  3. <?php $url = "https://api2.prices.tf/prices/".$datas["def_index"]."%3B".$datas["quality"]; $curl = curl_init($url); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $headers = array( "accept: application/json", "Authorization: Bearer " .$value. " ", ); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); //for debug only! curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $resp = curl_exec($curl); curl_close($curl); var_dump($resp); foreach ($inventories['rgDescriptions'] as $key => $description) { $samik = $description['app_data']; echo $datas["def_index"]."<br>"; echo $datas["quality"]; $unusual = $description['name_color']; if($unusual === "8650AC"){ //do something with it $icon_url = $description['icon_url']; //$count = count($description['descriptions']); foreach ($description['descriptions'] as $key => $effects) { $effectsValue = $effects['value']; if (strpos($effectsValue, '★ Unusual Effect') !== false) { $effectValue = $effects['value']; //$effectColor = $effects['color']; } /* if (str_contains($effectsValue, '★ Unusual Effect')) { $effectValue = $effects['value']; $effectColor = $effects['color']; } */ } //$effectValue = $description['descriptions'][1]['value']; //$effectColor = $description['descriptions'][1]['color']; echo $effectValue; //echo $effectColor; echo ' <div class="item"> <img src="http://cdn.steamcommunity.com/economy/image/' . $icon_url . '/100fx60f" /> <br /> ' . $description['market_name'] . ' </div> '; }else{ $description['appid']; $description['market_name']; $icon_url = $description['icon_url'];echo ' <div class="item"> <img src="http://cdn.steamcommunity.com/economy/image/' . $icon_url . '/100fx60f" /> <br /> ' . $description['market_name'] . ' </div> '; } ?>
  4. https://steamcommunity.com/profiles/76561198182213262/inventory/json/440/2 this is the file and I would like to get the def_index from rgDescriptions in descriptions in app_data foreach ($inventories['rgDescriptions'] as $key => $description) { if (isset($description['descriptions'])) { foreach ($description['descriptions'] as $key => $effects2) { if (isset($effects2['app_data'])) { $effectsValue2 = $effects2['app_data']; foreach ($effectsValue2 as $key => $treba) { if (isset($effectsValue2['def_index'])) { $effectsValue3 = $effectsValue2['def_index']; } } } } } } I made this but the respond is rly random
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.