Exemplo n.º 1
0
        public string GenerateWebsiteLink(ICrawlerResultItem item)
        {
            switch (item.Domain)
            {
            case CrawlerDomain.Yahoo:
                return("https://www.dejapan.com/en/top/mall/asp/detail.asp?code=v659181765");

            default:
                return(null);
            }
        }
Exemplo n.º 2
0
        public string GenerateWebsiteLink(ICrawlerResultItem item)
        {
            switch (item.Domain)
            {
            case CrawlerDomain.Surugaya:
                return($"https://neokyo.com/product/surugaya/{item.Id}");

            default:
                return(null);
            }
        }
Exemplo n.º 3
0
 public async void AddIgnoredItem(ICrawlerResultItem item)
 {
     _ignoredItems.Add(item.InternalId);
     IgnoredEntries.Add(new IgnoredItemEntry
     {
         Domain     = item.Domain,
         InternalId = item.InternalId,
         Name       = item.Name,
         ImageUrl   = item.ImageUrl,
         IgnoredAt  = DateTime.UtcNow
     });
     await _appVariables.IgnoredItems.SetAsync(IgnoredEntries);
 }
Exemplo n.º 4
0
 public async void AddWatchedEntry(ICrawlerResultItem entry)
 {
     _watchedItems.Add(entry.Id);
     Entries.Add(new WatchedItemDataEntry(new WatchedItemEntry
     {
         Domain   = entry.Domain,
         Id       = entry.Id,
         ImageUrl = entry.ImageUrl,
         Name     = entry.Name
     })
     {
         Data = entry
     });
     await _appVariables.WatchedItems.SetAsync(Entries.Select(dataEntry => dataEntry.WatchedItemEntry).ToList());
 }
Exemplo n.º 5
0
        public string GenerateWebsiteLink(ICrawlerResultItem item)
        {
            if (_settings.ProxyDomain != ProxyDomain.None)
            {
                var link = _linkHandlers
                           .First(handler => handler.HandlingDomain == _settings.ProxyDomain)
                           .GenerateWebsiteLink(item);
                if (link != null)
                {
                    return(link);
                }
            }

            return(_defaultHandler.GenerateWebsiteLink(item));
        }
Exemplo n.º 6
0
        public string GenerateWebsiteLink(ICrawlerResultItem item)
        {
            switch (item.Domain)
            {
            case CrawlerDomain.Surugaya:
                return
                    ($"https://zenmarket.jp/en/othershopproduct.aspx?u=https://www.suruga-ya.jp/product/detail/{item.Id}");

            case CrawlerDomain.Yahoo:
                return($"https://zenmarket.jp/en/auction.aspx?itemCode={item.Id}");

            default:
                return(null);
            }
        }
Exemplo n.º 7
0
        public string GenerateWebsiteLink(ICrawlerResultItem item)
        {
            switch (item.Domain)
            {
            case CrawlerDomain.Surugaya:
                return
                    ($"https://www.fromjapan.co.jp/en/special/order/confirm/https://www.suruga-ya.jp/product/detail/{item.Id}/11_1");

            case CrawlerDomain.Yahoo:
                return($"https://www.fromjapan.co.jp/en/auction/yahoo/input/{item.Id}");

            default:
                return(null);
            }
        }
Exemplo n.º 8
0
        public string GenerateWebsiteLink(ICrawlerResultItem item)
        {
            switch (item.Domain)
            {
            case CrawlerDomain.Surugaya:
                return($"https://www.suruga-ya.jp/product/detail/{item.Id}");

            case CrawlerDomain.Mandarake:
                return($"https://order.mandarake.co.jp/order/detailPage/item?itemCode={item.Id}");

            case CrawlerDomain.Yahoo:
                return($"https://page.auctions.yahoo.co.jp/jp/auction/{item.Id}");

            case CrawlerDomain.Mercari:
                return($"https://item.mercari.com/jp/{item.Id}");

            case CrawlerDomain.Lashinbang:
                return($"https://shop.lashinbang.com/products/detail/{item.Id}");

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
Exemplo n.º 9
0
 public bool IsItemIgnored(ICrawlerResultItem item)
 {
     return(_ignoredItems.Contains(item.InternalId));
 }
Exemplo n.º 10
0
 public bool IsWatched(ICrawlerResultItem item)
 {
     return(_watchedItems.Contains(item.Id));
 }
Exemplo n.º 11
0
        public void RemoveWatchedEntry(ICrawlerResultItem item)
        {
            var entry = Entries.First(dataEntry => dataEntry.WatchedItemEntry.Id.Equals(item.Id));

            RemoveWatchedEntry(entry);
        }