Example #1
0
 /**
  * @param string $index Index for $this->attributes
  * @param string $hash hashCode for item
  * @throws \Onyx\Destiny\Helpers\String\HashNotLocatedException
  */
 private function setAttributePullImage($index, $hash)
 {
     if ($hash == null || $hash == "") {
         return;
     }
     Images::saveImagesLocally($this->translator->map($hash, false));
     $this->attributes[$index] = $hash;
 }
Example #2
0
 /**
  * @return bool
  * @throws Helpers\Network\BungieOfflineException
  */
 public function getXurData()
 {
     $key = 'xur';
     if (Cache::has($key)) {
         return Cache::get($key);
     } else {
         $url = Constants::$xurData;
         $json = $this->getJson($url);
         if (!isset($json['Response']['data'])) {
             return false;
             // no xur data
         } else {
             $translator = new Hashes();
             $translator->setUrl($url);
             $items = '<strong>Xur Items</strong><br/><br />';
             foreach ($json['Response']['data']['saleItemCategories'] as $category) {
                 if ($category['categoryTitle'] == "Exotic Gear") {
                     foreach ($category['saleItems'] as $item) {
                         if (isset($item['item']['stats']) && count($item['item']['stats']) > 0) {
                             $items .= "<strong>" . $translator->map($item['item']['itemHash'], true) . '</strong>' . ' - <a href="' . $this->getItemUrl($item['item']['itemHash']) . '">url' . '</a><br />';
                             foreach ($item['item']['stats'] as $stat) {
                                 if ($stat['value'] != 0) {
                                     $items .= '  -->' . $translator->map($stat['statHash'], true) . ": " . number_format($stat['value']) . "<br />";
                                 }
                             }
                             $items .= '<br />';
                         }
                     }
                 }
             }
             Cache::put($key, $items, 120);
             return $items;
         }
     }
 }