8 |
import java.util.logging.Logger; |
import java.util.logging.Logger; |
9 |
|
|
10 |
import javax.servlet.ServletException; |
import javax.servlet.ServletException; |
11 |
|
import javax.servlet.annotation.WebServlet; |
12 |
import javax.servlet.http.HttpServlet; |
import javax.servlet.http.HttpServlet; |
13 |
import javax.servlet.http.HttpServletRequest; |
import javax.servlet.http.HttpServletRequest; |
14 |
import javax.servlet.http.HttpServletResponse; |
import javax.servlet.http.HttpServletResponse; |
20 |
import com.gc.android.market.api.model.Market.CommentsRequest; |
import com.gc.android.market.api.model.Market.CommentsRequest; |
21 |
|
|
22 |
|
|
23 |
|
@WebServlet(urlPatterns={"/ShowStats"}) |
24 |
public class ShowStats extends HttpServlet { |
public class ShowStats extends HttpServlet { |
25 |
private static final long serialVersionUID = 1L; |
private static final long serialVersionUID = 1L; |
26 |
|
|
75 |
} |
} |
76 |
|
|
77 |
protected AppBean lookupAppWorker(String query) { |
protected AppBean lookupAppWorker(String query) { |
|
final StringBuilder sb = new StringBuilder(); |
|
|
|
|
78 |
|
|
79 |
MarketSession session = new MarketSession(); |
MarketSession session = new MarketSession(); |
80 |
session.login(login,password); |
session.login(login,password); |
124 |
count = Math.min(10, commentsCb.getEntryCount() ); |
count = Math.min(10, commentsCb.getEntryCount() ); |
125 |
|
|
126 |
//log.warning("count=" + count + " start=" + start + " entryCount=" + commentsCb.getEntryCount() ); |
//log.warning("count=" + count + " start=" + start + " entryCount=" + commentsCb.getEntryCount() ); |
127 |
CommentsRequest commentsRequest = buildCommentRequest(appId,start,count); |
for (int i=0; i<5;i++) { |
128 |
session.append(commentsRequest, commentsCb); |
CommentsRequest commentsRequest = buildCommentRequest(appId,start,count); |
129 |
start +=10; |
session.append(commentsRequest, commentsCb); |
130 |
|
start +=10; |
131 |
|
} |
132 |
|
|
|
CommentsRequest commentsRequest2 = buildCommentRequest(appId,start,count); |
|
|
session.append(commentsRequest2, commentsCb); |
|
133 |
session.flush(); |
session.flush(); |
134 |
|
|
|
start +=10; |
|
|
|
|
135 |
if (start >= MAXCOMMENTS) |
if (start >= MAXCOMMENTS) |
136 |
break; //emergency brake |
break; //emergency brake |
137 |
|
|