Esempio n. 1
0
        public bool Fired(ScrapperResults result)
        {
            var priceMeResult = (PriceMeScrapperResults)result;

            _priceValue = priceMeResult.Price;
            return(priceMeResult.Title.ToLowerInvariant().Contains(TitleToMatch.ToLowerInvariant()) &&
                   priceMeResult.Price <= PriceToMatch);
        }
Esempio n. 2
0
        public void RunAction(ScrapperResults results)
        {
            // no configuration, do nothing
            if (_configuration == null)
            {
                return;
            }

            TwilioClient.Init(_configuration.AccountSid, _configuration.AuthToken);

            var message = MessageResource.Create(
                body: _transformResultsToHumanRedable(results),
                from: new PhoneNumber(_configuration.FromNumber),
                to: new PhoneNumber(_configuration.ToNumber)
                );

            _logger.Log($"Twilio SMS Action: Sending SMS to {_configuration.ToNumber} because alert fired");
        }
Esempio n. 3
0
        public static string TransformPriceMeResultsToSms(ScrapperResults results)
        {
            var priceMeScrapperResult = (PriceMeScrapperResults)results;

            return($"Price Me Scrapper({results.ScrapperUri}) result found this match: {priceMeScrapperResult.Title} with price: {priceMeScrapperResult.Price}");
        }
Esempio n. 4
0
 public bool Fired(ScrapperResults result)
 {
     return(((TestScrapperResults)result).Test == _test);
 }