Пример #1
0
        public List <Product> GetProducts()
        {
            // nemlig implemented IP based queueing since they have too many users trying to access the site, so the api call may fail.
            var str = @"{'Products':[{'Score':67.727646,'TemplateName':'productlistitem','PrimaryImage':'https://live.nemligstatic.com/scommerce/images/druer-roede-stenfri.jpg?i=7zvgWKmk/2301134','Availability':{'IsDeliveryAvailable':true,'IsAvailableInStock':true,'ReasonMessageKeys':[]},'Id':'2301134','Name':'Druer røde stenfri','Category':'Druer, kiwi og stenfrugter','Url':'druer-roede-stenfri-2301134','UnitPrice':'40,00 kr./Kg.','UnitPriceCalc':40.0,'UnitPriceLabel':'kr./Kg.','DiscountItem':true,'Description':'500 g / Crimson / Peru / Klasse 1','SaleBeforeLastSalesDate':0,'Price':20.0,'Campaign':{'MinQuantity':2,'MaxQuantity':0,'TotalPrice':35.0,'VariousPriceProductsCampaign':false,'CampaignPrice':35.0,'CampaignUnitPrice':null,'Type':'ProductCampaignMixOffer','DiscountSavings':5.0},'Labels':['Discount'],'SearchDescription':['VINDRUER'],'ProductSubGroupNumber':'0400200006','ProductSubGroupName':'Blød Frugt','ProductCategoryGroupNumber':'0400200000','ProductCategoryGroupName':'Frugt og bær ','ProductMainGroupNumber':'0400000000','ProductMainGroupName':'Frugt/grønt'},{'Score':67.727646,'TemplateName':'productlistitem','PrimaryImage':'https://live.nemligstatic.com/scommerce/images/druer-groenne-stenfri.jpg?i=lQwOOtBT/2301135','Availability':{'IsDeliveryAvailable':true,'IsAvailableInStock':true,'ReasonMessageKeys':[]},'CampaignAttribute':'Priskup','Id':'2301135','Name':'Druer grønne stenfri','Category':'Druer, kiwi og stenfrugter','Url':'druer-groenne-stenfri-2301135','UnitPrice':'40,00 kr./Kg.','UnitPriceCalc':40.0,'UnitPriceLabel':'kr./Kg.','DiscountItem':true,'Description':'500 g / Autumn Crisp / Sydafrika / Klasse 1','SaleBeforeLastSalesDate':0,'Price':20.0,'Campaign':{'MinQuantity':2,'MaxQuantity':0,'TotalPrice':35.0,'VariousPriceProductsCampaign':false,'CampaignPrice':35.0,'CampaignUnitPrice':null,'Type':'ProductCampaignMixOffer','DiscountSavings':5.0},'Labels':['Discount'],'SearchDescription':['VINDRUER'],'ProductSubGroupNumber':'0400200006','ProductSubGroupName':'Blød Frugt','ProductCategoryGroupNumber':'0400200000','ProductCategoryGroupName':'Frugt og bær ','ProductMainGroupNumber':'0400000000','ProductMainGroupName':'Frugt/grønt'},{'Score':67.727646,'TemplateName':'productlistitem','PrimaryImage':'https://live.nemligstatic.com/scommerce/images/druer-roede-stenfri-oeko.jpg?i=zdj6An27/5002563','Availability':{'IsDeliveryAvailable':true,'IsAvailableInStock':true,'ReasonMessageKeys':[]},'CampaignAttribute':'Priskup','Id':'5002563','Name':'Druer røde stenfri øko.','Category':'Økologisk frugt','Url':'druer-roede-stenfri-oeko-5002563','UnitPrice':'62,50 kr./Kg.','UnitPriceCalc':62.5,'UnitPriceLabel':'kr./Kg.','DiscountItem':true,'Description':'400 g / Jack salute / Sydafrika / Klasse 1','SaleBeforeLastSalesDate':0,'Price':25.0,'Campaign':{'DiscountSavings':5.0,'MaxQuantity':0,'CampaignPrice':20.0,'CampaignUnitPrice':50.0,'Type':'ProductCampaignDiscount'},'Labels':['Discount','Øko (europæisk)'],'SearchDescription':['STENFRI VINDRUER'],'ProductSubGroupNumber':'0400200006','ProductSubGroupName':'Blød Frugt','ProductCategoryGroupNumber':'0400200000','ProductCategoryGroupName':'Frugt og bær ','ProductMainGroupNumber':'0400000000','ProductMainGroupName':'Frugt/grønt'},{'Score':67.727646,'TemplateName':'productlistitem','PrimaryImage':'https://live.nemligstatic.com/scommerce/images/avocado-formodnet.jpg?i=-W3RsDlk/5004143','Availability':{'IsDeliveryAvailable':true,'IsAvailableInStock':true,'ReasonMessageKeys':[]},'Id':'5004143','Name':'Avocado formodnet','Category':'Øvrig fint grønt','Url':'avocado-formodnet-5004143','UnitPrice':'11,50 kr./Stk.','UnitPriceCalc':11.5,'UnitPriceLabel':'kr./Stk.','DiscountItem':false,'Description':'2 stk. / Colombia / Klasse 1','SaleBeforeLastSalesDate':0,'Price':23.0,'Campaign':{'MinQuantity':2,'MaxQuantity':0,'TotalPrice':35.0,'CampaignPrice':35.0,'CampaignUnitPrice':null,'Type':'ProductCampaignBuyXForY','DiscountSavings':11.0},'Labels':[],'SearchDescription':['AVOCADO'],'ProductSubGroupNumber':'0400100005','ProductSubGroupName':'Fin Grønt','ProductCategoryGroupNumber':'0400100000','ProductCategoryGroupName':'Grønt','ProductMainGroupNumber':'0400000000','ProductMainGroupName':'Frugt/grønt'},{'Score':67.727646,'TemplateName':'productlistitem','PrimaryImage':'https://live.nemligstatic.com/scommerce/images/jordbaer-oeko.jpg?i=Qj-x-2an/5026299','Availability':{'IsDeliveryAvailable':true,'IsAvailableInStock':true,'ReasonMessageKeys':[]},'CampaignAttribute':'Priskup','Id':'5026299','Name':'Jordbær øko.','Category':'Økologiske bær','Url':'jordbaer-oeko-5026299','UnitPrice':'45,00 kr./Kg.','UnitPriceCalc':45.0,'UnitPriceLabel':'kr./Kg.','DiscountItem':false,'Description':'1 kg / Spanien / Klasse 1','SaleBeforeLastSalesDate':0,'Price':45.0,'Campaign':{'DiscountSavings':15.0,'MaxQuantity':0,'CampaignPrice':30.0,'CampaignUnitPrice':30.0,'Type':'ProductCampaignDiscount'},'Labels':['Øko (europæisk)'],'SearchDescription':['JORDBÆR BÆR'],'ProductSubGroupNumber':'0400200009','ProductSubGroupName':'Friske Bær','ProductCategoryGroupNumber':'0400200000','ProductCategoryGroupName':'Frugt og bær ','ProductMainGroupNumber':'0400000000','ProductMainGroupName':'Frugt/grønt'},{'Score':67.727646,'TemplateName':'productlistitem','PrimaryImage':'https://live.nemligstatic.com/scommerce/images/asparges-groenne-oeko.jpg?i=mcWml2rV/5017025','Availability':{'IsDeliveryAvailable':true,'IsAvailableInStock':true,'ReasonMessageKeys':[]},'Id':'5017025','Name':'Asparges grønne øko.','Category':'Økologiske grøntsager og snitsalater','Url':'asparges-groenne-oeko-5017025','UnitPrice':'80,00 kr./Kg.','UnitPriceCalc':80.0,'UnitPriceLabel':'kr./Kg.','DiscountItem':true,'Description':'250 g / Spanien / Klasse 1','SaleBeforeLastSalesDate':0,'Price':20.0,'Campaign':{'DiscountSavings':5.0,'MaxQuantity':0,'CampaignPrice':15.0,'CampaignUnitPrice':60.0,'Type':'ProductCampaignDiscount'},'Labels':['','Discount','Øko (europæisk)'],'SearchDescription':['ASPARGES'],'ProductSubGroupNumber':'0400100005','ProductSubGroupName':'Fin Grønt','ProductCategoryGroupNumber':'0400100000','ProductCategoryGroupName':'Grønt','ProductMainGroupNumber':'0400000000','ProductMainGroupName':'Frugt/grønt'},{'Score':67.727646,'TemplateName':'productlistitem','PrimaryImage':'https://live.nemligstatic.com/scommerce/images/gulerod-revet.jpg?i=Co8wwhTP/5032796','Availability':{'IsDeliveryAvailable':true,'IsAvailableInStock':true,'ReasonMessageKeys':[]},'Id':'5032796','Name':'Gulerod revet','Category':'Salat','Url':'gulerod-revet-5032796','UnitPrice':'50,00 kr./Kg.','UnitPriceCalc':50.0,'UnitPriceLabel':'kr./Kg.','DiscountItem':false,'Description':'200 g / Skyllet og klar til brug','SaleBeforeLastSalesDate':2,'Price':10.0,'Campaign':{'DiscountSavings':3.0,'MaxQuantity':0,'CampaignPrice':7.0,'CampaignUnitPrice':35.0,'Type':'ProductCampaignDiscount'},'Labels':[],'SearchDescription':['GULERØDDER'],'ProductSubGroupNumber':'0400100007','ProductSubGroupName':'Gulerødder / Rodfrugter','ProductCategoryGroupNumber':'0400100000','ProductCategoryGroupName':'Grønt','ProductMainGroupNumber':'0400000000','ProductMainGroupName':'Frugt/grønt'},{'Score':67.727646,'TemplateName':'productlistitem','PrimaryImage':'https://live.nemligstatic.com/scommerce/images/skalotteloeg.jpg?i=Qj-x-2an/5020168','Availability':{'IsDeliveryAvailable':true,'IsAvailableInStock':true,'ReasonMessageKeys':[]},'Id':'5020168','Name':'Skalotteløg','Category':'Løg, rødløg og hvidløg','Url':'skalotteloeg-5020168','UnitPrice':'75,00 kr./Kg.','UnitPriceCalc':75.0,'UnitPriceLabel':'kr./Kg.','DiscountItem':false,'Description':'200 g / Danmark / Klasse 1','SaleBeforeLastSalesDate':0,'Price':15.0,'Campaign':{'DiscountSavings':5.0,'MaxQuantity':0,'CampaignPrice':10.0,'CampaignUnitPrice':50.0,'Type':'ProductCampaignDiscount'},'Labels':['Dansk'],'SearchDescription':['LØG'],'ProductSubGroupNumber':'0400100012','ProductSubGroupName':'Løg','ProductCategoryGroupNumber':'0400100000','ProductCategoryGroupName':'Grønt','ProductMainGroupNumber':'0400000000','ProductMainGroupName':'Frugt/grønt'},{'Score':67.727646,'TemplateName':'productlistitem','PrimaryImage':'https://live.nemligstatic.com/scommerce/images/cherry-passion.jpg?i=Qj-x-2an/5020664','Availability':{'IsDeliveryAvailable':true,'IsAvailableInStock':true,'ReasonMessageKeys':[]},'Id':'5020664','Name':'Cherry Passion','Category':'Tomater','Brand':'Red Star','Url':'cherry-passion-5020664','UnitPrice':'100,00 kr./Kg.','UnitPriceCalc':100.0,'UnitPriceLabel':'kr./Kg.','DiscountItem':false,'Description':'250 g / Holland / Klasse 1','SaleBeforeLastSalesDate':0,'Price':25.0,'Campaign':{'DiscountSavings':5.0,'MaxQuantity':0,'CampaignPrice':20.0,'CampaignUnitPrice':80.0,'Type':'ProductCampaignDiscount'},'Labels':[],'SearchDescription':['TOMAT'],'ProductSubGroupNumber':'0400100003','ProductSubGroupName':'Tomat','ProductCategoryGroupNumber':'0400100000','ProductCategoryGroupName':'Grønt','ProductMainGroupNumber':'0400000000','ProductMainGroupName':'Frugt/grønt'},{'Score':67.727646,'TemplateName':'productlistitem','PrimaryImage':'https://live.nemligstatic.com/scommerce/images/guleroedder-baby.jpg?i=EgiiO9pC/5021842','Availability':{'IsDeliveryAvailable':true,'IsAvailableInStock':true,'ReasonMessageKeys':[]},'Id':'5021842','Name':'Gulerødder baby','Category':'Vinterferie for voksne','Brand':'Dole','Url':'guleroedder-baby-5021842','UnitPrice':'82,35 kr./Kg.','UnitPriceCalc':82.35,'UnitPriceLabel':'kr./Kg.','DiscountItem':false,'Description':'85 g / Skyllet og klar til brug','SaleBeforeLastSalesDate':2,'Price':7.0,'Campaign':{'MinQuantity':4,'MaxQuantity':0,'TotalPrice':20.0,'VariousPriceProductsCampaign':false,'CampaignPrice':20.0,'CampaignUnitPrice':null,'Type':'ProductCampaignMixOffer','DiscountSavings':8.0},'Labels':[],'SearchDescription':['GULERØDDER'],'ProductSubGroupNumber':'0400100007','ProductSubGroupName':'Gulerødder / Rodfrugter','ProductCategoryGroupNumber':'0400100000','ProductCategoryGroupName':'Grønt','ProductMainGroupNumber':'0400000000','ProductMainGroupName':'Frugt/grønt'},{'Score':67.727646,'TemplateName':'productlistitem','PrimaryImage':'https://live.nemligstatic.com/scommerce/images/brune-champignon-i-skiver-oeko.jpg?i=t7gxdwe8/5040331','Availability':{'IsDeliveryAvailable':true,'IsAvailableInStock':true,'ReasonMessageKeys':[]},'Id':'5040331','Name':'Brune champignon i skiver øko.','Category':'Økologiske grøntsager og snitsalater','Brand':'Tvedemose','Url':'brune-champignon-i-skiver-oeko-5040331','UnitPrice':'90,00 kr./Kg.','UnitPriceCalc':90.0,'UnitPriceLabel':'kr./Kg.','DiscountItem':false,'Description':'200 g / Danmark / Tvedemose','SaleBeforeLastSalesDate':2,'Price':18.0,'Campaign':{'MinQuantity':2,'MaxQuantity':0,'TotalPrice':30.0,'VariousPriceProductsCampaign':true,'CampaignPrice':30.0,'CampaignUnitPrice':null,'Type':'ProductCampaignMixOffer','DiscountSavings':6.0},'Labels':['Dansk','Øko (dansk)','Øko (europæisk)'],'SearchDescription':['CHAMPIGNON SVAMPE'],'ProductSubGroupNumber':'0400100015','ProductSubGroupName':'Svampe','ProductCategoryGroupNumber':'0400100000','ProductCategoryGroupName':'Grønt','ProductMainGroupNumber':'0400000000','ProductMainGroupName':'Frugt/grønt'},{'Score':67.727646,'TemplateName':'productlistitem','PrimaryImage':'https://live.nemligstatic.com/scommerce/images/champignon-i-skiver-oeko.jpg?i=t7gxdwe8/5040333','Availability':{'IsDeliveryAvailable':true,'IsAvailableInStock':true,'ReasonMessageKeys':[]},'Id':'5040333','Name':'Champignon i skiver øko.','Category':'Økologiske grøntsager og snitsalater','Brand':'Tvedemose','Url':'champignon-i-skiver-oeko-5040333','UnitPrice':'80,00 kr./Kg.','UnitPriceCalc':80.0,'UnitPriceLabel':'kr./Kg.','DiscountItem':true,'Description':'200 g / Danmark / Tvedemose','SaleBeforeLastSalesDate':2,'Price':16.0,'Campaign':{'MinQuantity':2,'MaxQuantity':0,'TotalPrice':30.0,'VariousPriceProductsCampaign':true,'CampaignPrice':30.0,'CampaignUnitPrice':null,'Type':'ProductCampaignMixOffer','DiscountSavings':6.0},'Labels':['Dansk','Discount','Øko (dansk)','Øko (europæisk)'],'SearchDescription':['CHAMPIGNON SVAMPE'],'ProductSubGroupNumber':'0400100015','ProductSubGroupName':'Svampe','ProductCategoryGroupNumber':'0400100000','ProductCategoryGroupName':'Grønt','ProductMainGroupNumber':'0400000000','ProductMainGroupName':'Frugt/grønt'},{'Score':67.727646,'TemplateName':'productlistitem','PrimaryImage':'https://live.nemligstatic.com/scommerce/images/rodfrugtchips-toerrede-oeko.jpg?i=YxLMPtGD/5044102','Availability':{'IsDeliveryAvailable':true,'IsAvailableInStock':true,'ReasonMessageKeys':[]},'CampaignAttribute':'Prioriteret tilbudsforside','Id':'5044102','Name':'Rodfrugtchips tørrede øko.','Category':'Økologiske grøntsager og snitsalater','Brand':'Tvedemose','Url':'rodfrugtchips-toerrede-oeko-5044102','UnitPrice':'57,14 kr./Kg.','UnitPriceCalc':57.14,'UnitPriceLabel':'kr./Kg.','DiscountItem':false,'Description':'35 g / Tvedemose','SaleBeforeLastSalesDate':30,'Price':20.0,'Campaign':{'DiscountPercent':20,'DiscountSavings':4.0,'CampaignPrice':16.0,'CampaignUnitPrice':45.71,'Type':'ProductCampaignDiscountPercent'},'Labels':['Dansk','Nøglehulsmærket','Øko (dansk)','Øko (europæisk)'],'SearchDescription':['RODFRUGTCHIPS CHIPS'],'ProductSubGroupNumber':'0400400001','ProductSubGroupName':'Tørvarer','ProductCategoryGroupNumber':'0400400000','ProductCategoryGroupName':'Dadler, abrikoser mv.','ProductMainGroupNumber':'0400000000','ProductMainGroupName':'Frugt/grønt'},{'Score':67.727646,'TemplateName':'productlistitem','PrimaryImage':'https://live.nemligstatic.com/scommerce/images/zittauerloeg-toerrede-oeko.jpg?i=IefJswmC/5044104','Availability':{'IsDeliveryAvailable':true,'IsAvailableInStock':true,'ReasonMessageKeys':[]},'CampaignAttribute':'Prioriteret tilbudsforside','Id':'5044104','Name':'Zittauerløg tørrede øko.','Category':'Økologiske grøntsager og snitsalater','Brand':'Tvedemose','Url':'zittauerloeg-toerrede-oeko-5044104','UnitPrice':'66,67 kr./Kg.','UnitPriceCalc':66.67,'UnitPriceLabel':'kr./Kg.','DiscountItem':false,'Description':'30 g / Tvedemose','SaleBeforeLastSalesDate':30,'Price':20.0,'Campaign':{'DiscountPercent':20,'DiscountSavings':4.0,'CampaignPrice':16.0,'CampaignUnitPrice':53.33,'Type':'ProductCampaignDiscountPercent'},'Labels':['Dansk','Nøglehulsmærket','Øko (dansk)','Øko (europæisk)'],'SearchDescription':['TØRREDE LØG'],'ProductSubGroupNumber':'0400400001','ProductSubGroupName':'Tørvarer','ProductCategoryGroupNumber':'0400400000','ProductCategoryGroupName':'Dadler, abrikoser mv.','ProductMainGroupNumber':'0400000000','ProductMainGroupName':'Frugt/grønt'},{'Score':67.727646,'TemplateName':'productlistitem','PrimaryImage':'https://live.nemligstatic.com/scommerce/images/roedloeg-toerrede-oeko.jpg?i=IefJswmC/5044106','Availability':{'IsDeliveryAvailable':true,'IsAvailableInStock':true,'ReasonMessageKeys':[]},'CampaignAttribute':'Prioriteret tilbudsforside','Id':'5044106','Name':'Rødløg tørrede øko.','Category':'Økologiske grøntsager og snitsalater','Brand':'Tvedemose','Url':'roedloeg-toerrede-oeko-5044106','UnitPrice':'66,67 kr./Kg.','UnitPriceCalc':66.67,'UnitPriceLabel':'kr./Kg.','DiscountItem':false,'Description':'30 g / Tvedemose','SaleBeforeLastSalesDate':30,'Price':20.0,'Campaign':{'DiscountPercent':20,'DiscountSavings':4.0,'CampaignPrice':16.0,'CampaignUnitPrice':53.33,'Type':'ProductCampaignDiscountPercent'},'Labels':['Dansk','Nøglehulsmærket','Øko (dansk)','Øko (europæisk)'],'SearchDescription':['RØDLØG LØG'],'ProductSubGroupNumber':'0400400001','ProductSubGroupName':'Tørvarer','ProductCategoryGroupNumber':'0400400000','ProductCategoryGroupName':'Dadler, abrikoser mv.','ProductMainGroupNumber':'0400000000','ProductMainGroupName':'Frugt/grønt'},{'Score':67.727646,'TemplateName':'productlistitem','PrimaryImage':'https://live.nemligstatic.com/scommerce/images/aeblechips-toerrede-oeko.jpg?i=IefJswmC/5044107','Availability':{'IsDeliveryAvailable':true,'IsAvailableInStock':true,'ReasonMessageKeys':[]},'CampaignAttribute':'Prioriteret tilbudsforside','Id':'5044107','Name':'Æblechips tørrede øko.','Category':'Økologisk frugt','Brand':'Tvedemose','Url':'aeblechips-toerrede-oeko-5044107','UnitPrice':'60,00 kr./Kg.','UnitPriceCalc':60.00,'UnitPriceLabel':'kr./Kg.','DiscountItem':false,'Description':'30 g / Tvedemose','SaleBeforeLastSalesDate':30,'Price':18.0,'Campaign':{'DiscountPercent':20,'DiscountSavings':3.6,'CampaignPrice':14.4,'CampaignUnitPrice':48.00,'Type':'ProductCampaignDiscountPercent'},'Labels':['Øko (dansk)','Øko (europæisk)'],'SearchDescription':['ÆBLECHIPS CHIPS'],'ProductSubGroupNumber':'0400400001','ProductSubGroupName':'Tørvarer','ProductCategoryGroupNumber':'0400400000','ProductCategoryGroupName':'Dadler, abrikoser mv.','ProductMainGroupNumber':'0400000000','ProductMainGroupName':'Frugt/grønt'},{'Score':67.727646,'TemplateName':'productlistitem','PrimaryImage':'https://live.nemligstatic.com/scommerce/images/kartofler-i-skiver-oeko.jpg?i=p0Ut1NYb/5038582','Availability':{'IsDeliveryAvailable':true,'IsAvailableInStock':true,'ReasonMessageKeys':[]},'Id':'5038582','Name':'Kartofler i skiver øko.','Category':'Økologiske grøntsager og snitsalater','Url':'kartofler-i-skiver-oeko-5038582','UnitPrice':'42,86 kr./Kg.','UnitPriceCalc':42.86,'UnitPriceLabel':'kr./Kg.','DiscountItem':false,'Description':'m. skræl / 350 g / Skåret og klar til brug','SaleBeforeLastSalesDate':2,'Price':15.0,'Campaign':{'DiscountSavings':5.0,'MaxQuantity':0,'CampaignPrice':10.0,'CampaignUnitPrice':28.57,'Type':'ProductCampaignDiscount'},'Labels':['Øko (dansk)','Øko (europæisk)'],'SearchDescription':['KARTOFLER'],'ProductSubGroupNumber':'0400100008','ProductSubGroupName':'Kartofler','ProductCategoryGroupNumber':'0400100000','ProductCategoryGroupName':'Grønt','ProductMainGroupNumber':'0400000000','ProductMainGroupName':'Frugt/grønt'},{'Score':67.727646,'TemplateName':'productlistitem','PrimaryImage':'https://live.nemligstatic.com/scommerce/images/ananas-kaempe.jpg?i=mcWml2rV/5046282','Availability':{'IsDeliveryAvailable':true,'IsAvailableInStock':true,'ReasonMessageKeys':[]},'Id':'5046282','Name':'Ananas Kæmpe','Category':'Eksotisk frugt','Url':'ananas-kaempe-5046282','UnitPrice':'30,00 kr./Stk.','UnitPriceCalc':30.0,'UnitPriceLabel':'kr./Stk.','DiscountItem':false,'Description':'1 stk. ca. 2 kg / Costa Rica / Klasse 1','SaleBeforeLastSalesDate':0,'Price':30.0,'Campaign':{'DiscountSavings':5.0,'MaxQuantity':0,'CampaignPrice':25.0,'CampaignUnitPrice':25.0,'Type':'ProductCampaignDiscount'},'Labels':[],'SearchDescription':['ANANAS'],'ProductSubGroupNumber':'0400200008','ProductSubGroupName':'Eksotisk Frugt','ProductCategoryGroupNumber':'0400200000','ProductCategoryGroupName':'Frugt og bær ','ProductMainGroupNumber':'0400000000','ProductMainGroupName':'Frugt/grønt'}],'ProductGroupId':'f4824940-3647-4ab5-9af0-6e48635c11bb','Start':0,'NumFound':18,'Advertisements':[]}";

            if (_cachedResult == "")
            {
                try
                {
                    _cachedResult = WebWorker.DownloadPage("https://www.nemlig.com/webapi/4CbKt3-4-gIeGjmXZ/2020040608-180-600/1/0/Products/GetByProductGroupId?pageindex=-1&pagesize=-1&productGroupId=f4824940-3647-4ab5-9af0-6e48635c11bb");
                }
                catch
                {
                    _cachedResult = str;
                }
            }

            var o = JObject.Parse(_cachedResult);

            foreach (var p in o["Products"])
            {
                _outsideProducts.Add(new Product
                {
                    Category    = (string)p["ProductCategoryGroupName"],
                    Description = (string)p["Description"],
                    Name        = (string)p["Name"],
                    Picture     = (string)p["PrimaryImage"],
                    Price       = (decimal)p["UnitPriceCalc"],
                    Unit        = (string)p["UnitPriceLabel"],
                });
            }

            return(_outsideProducts);
        }
Пример #2
0
        public List <Product> GetProducts()
        {
            var baseUrl = "https://ny.skagenfood.dk/";

            if (_cachedResult == "")
            {
                _cachedResult = WebWorker.DownloadPage("https://ny.skagenfood.dk/api/headless/content/fetchcontentbykey?key=%2Fda-dk%2Ffiskekasser&includeGlobalData=true&format=json");
                //_cachedResult = WebWorker.DownloadPage("file:///C:/Users/catalin/Desktop/ass.json");
            }

            var o = JObject.Parse(_cachedResult);

            foreach (var entry in o["content"]["page"]["content"]["selectedSubscriptionPackages"])
            {
                var remoteProducts = entry["products"];

                var category = (string)entry["recipeType"]; // could be productCategory, the admin can edit it anyways.

                var pic = (string)entry["imageUrl"];

                // add the main product

                CreateProduct(remoteProducts[0], category, baseUrl, pic);

                foreach (var product in remoteProducts)
                {
                    foreach (var addon in product["addonProducts"])
                    {
                        if (addon != null)
                        {
                            CreateProduct(addon, "uncategorised", baseUrl, (string)addon["addonImageUrl"]);
                        }
                    }
                }
            }

            return(_outsideProducts);
        }
Пример #3
0
        public List <Product> GetProducts()
        {
            if (_cachedResult == "")
            {
                _cachedResult = WebWorker.DownloadPage("https://coopmad-website-prod-endpoint.azureedge.net/api/search/products?term=%2a&categories=5&lastFacet=sortby&sortby=Popularity&pageSize=21");
                //_cachedResult = WebWorker.DownloadPage("file:///C:/Users/catalin/Desktop/coop.json");
            }

            var o = JObject.Parse(_cachedResult);

            foreach (var p in o["products"])
            {
                _outsideProducts.Add(new Product
                {
                    Category    = (string)p["category"],
                    Description = (string)p["spotText"],
                    Name        = (string)p["displayName"],
                    Picture     = (string)p["image"] + "width=130&height=130&mode=pad&format=jpg&bgcolor=ffffff",
                    Price       = (decimal)p["salesPrice"]["amount"]
                });
            }

            return(_outsideProducts);
        }