Package lupos.event.producer.ebay.parser

Examples of lupos.event.producer.ebay.parser.JSObject


    int counter = 0;
   
    try {
      for (int page = 1, max = (int) Math.ceil((double) this.config.resultCount / Configuration.ENTRIES_PER_PAGE); this.loop && page <= max; page++) {
        final String content = this.getContent(page);
        final JSObject model = JSONParser.parse(content);
       
        try {
          JSObject searchResult =
              model.get(this.config.opName + "Response").get("searchResult");
          final int count = (page == max)
              ? ((this.config.resultCount - 1) % Configuration.ENTRIES_PER_PAGE) + 1
              : Integer.parseInt(searchResult.get("@count").toString());
   
          for (int i = 0; this.loop && i < count; i++) {
            counter++;
            JSObject item = searchResult.get("item").get(i);   
            auctions.add(new Auction(item));         
          }
        }
        catch (NullPointerException e) {
          // ignore...
View Full Code Here


   
    while (this.loop) {
      try {
        for (int page = 1, max = (int) Math.ceil((double) this.config.resultCount / Configuration.ENTRIES_PER_PAGE); this.loop && page <= max; page++) {
          final String content = this.getContent(page);
          final JSObject model = JSONParser.parse(content);
         
          try {
            JSObject searchResult =
                model.get(this.config.opName + "Response").get("searchResult");
            final int count = (page == max)
                ? ((this.config.resultCount - 1) % Configuration.ENTRIES_PER_PAGE) + 1
                : Integer.parseInt(searchResult.get("@count").toString());
     
            for (int i = 0; this.loop && i < count; i++) {
              counter++;
              JSObject item = searchResult.get("item").get(i);   
              Auction auction = new Auction(item);
             
              try {
                this.buffer.put(auction);
              }
View Full Code Here

TOP

Related Classes of lupos.event.producer.ebay.parser.JSObject

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.