Package ru.snake.amazonwatcher.model

Examples of ru.snake.amazonwatcher.model.PriceInfo


  public static void updateProductPrice(AbstractProductModel model, int index) {
    ProductInfo pi = model.get(index);
    SiteParser parser = ParserFactory.createParser(pi.getHost());

    if (parser != null) {
      PriceInfo newPrice;

      parser.parseUrl(pi.getUrl());

      newPrice = parser.getPrice();

      if (newPrice.getPrice() > 0.01f
          && Math.abs(newPrice.getPrice() - pi.getPrice()) > 0.01f) {
        try {
          new PriceChangedDialog(pi, newPrice);
        } catch (Exception e) {
        }
      }
View Full Code Here


          SiteParser parser = ParserFactory.createParser(pi.getHost());

          setStatus(pi.getName());

          if (parser != null) {
            PriceInfo newPrice;

            parser.parseUrl(pi.getUrl());
            newPrice = parser.getPrice();

            pi.setPriceInfo(newPrice);
View Full Code Here

  protected static final String PRICE_CURR = "EUR";

  public AmazonParser() {
    super();

    price = new PriceInfo(PRICE_CURR);
  }
View Full Code Here

      if (parts.length == 1) {
        return parts[0];
      }

      if (parts.length == 2) {
        price = new PriceInfo(parts[0]);

        return parts[1];
      }
    }
View Full Code Here

  protected static final String PRICE_CURR = "GBP";

  public GameCoParser() {
    super();

    price = new PriceInfo(PRICE_CURR);
  }
View Full Code Here

  protected String parseDocument(Document document) {
    Element element = document.select("div.our-price").first();
    Element currency = document.select("div.our-price > meta").first();

    if (currency != null) {
      price = new PriceInfo(currency.attr("content"));
    }

    if (element != null) {
      return element.text().trim();
    }
View Full Code Here

TOP

Related Classes of ru.snake.amazonwatcher.model.PriceInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.