Menu

A new feature i create!

2007-08-23
2013-04-22
  • Thiago Melo ReiserFS

    I put a new method to get the item by the item name

            /**
            * itemnameFetch
            *
            * This function returns the unserialized XML data
            * for an item from the Armory. But now you can use the Item Name instead of the Item ID
            * @return string[]                              An associative array
            * @param string         $itemNAME         The NAME of the item
            */
            function itemnameFetch($itemNAME){

                    $url = $this->armory."search.xml?searchQuery=".str_replace(" ", "+",$itemNAME)."&searchType=items";
                    $item_ary = $this->xmlToArray($this->xmlFetch($url));
                    $url = $this->armory."item-tooltip.xml?i=".$item_ary['armorysearch']['searchresults']['items']['item']['attributes']['id'];
                    return $this->xmlToArray($this->xmlFetch($url));

            }

    Works like a charm! i hope this can be useful.

    Thiago Melo <ReiserFS> http://thiago.oxente.org

     
    • Claire Matthews

      Claire Matthews - 2007-08-31

      Thanks for this starting point, I've cleaned up and expanded upon this function and will include it in the class soon as I figure out how. ;)

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.