public bool Fired(ScrapperResults result) { var priceMeResult = (PriceMeScrapperResults)result; _priceValue = priceMeResult.Price; return(priceMeResult.Title.ToLowerInvariant().Contains(TitleToMatch.ToLowerInvariant()) && priceMeResult.Price <= PriceToMatch); }
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"); }
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}"); }
public bool Fired(ScrapperResults result) { return(((TestScrapperResults)result).Test == _test); }