示例#1
0
        private ItemsStructure ConstructSmallStructure(string itemLink, HtmlNode nodeToDo)
        {
            //bool proxyChanged = false;
            float price = -1;

            /*proxyNeeded:
             * if (!proxyChanged)
             * {
             *  try
             *  {
             *      if (itemLink != "NVM")
             *          price = ComputePrice(itemLink);
             *      else
             *          price = -3;
             *  }
             *  catch (WebException e)
             *  {
             *      Console.WriteLine(e.Message);
             *      if (e.Message == "The remote server returned an error: (429) Too Many Requests.")
             *      {
             *          wp = IP_Proxy.GetNextProxy();
             *          proxyChanged = true;
             *      }
             *      goto proxyNeeded;
             *  }
             * }*/
            ItemsStructure StructureToReturn = new ItemsStructure
            {
                ItemLink  = ReplaceSpecialChars(itemLink),
                ItemName  = nodeToDo.InnerHtml,
                ItemPrice = price
            };

            return(StructureToReturn);
        }
示例#2
0
        private TradeDetails SingleRowToSend(ItemsStructure row, DataStructure structureToBeParsed)
        {
            TradeDetails detailsToSend = new TradeDetails();

            detailsToSend           = new TradeDetails();
            detailsToSend.ItemLink  = row.ItemLink;
            detailsToSend.ItemName  = row.ItemName;
            detailsToSend.ItemPrice = row.ItemPrice.ToString();
            detailsToSend.TradeLink = "https://csgolounge.com/" + structureToBeParsed.Tradelink;
            return(detailsToSend);
        }