com.akdeniz.googleplaycrawler.GooglePlay.SearchResponse Java Examples

The following examples show how to use com.akdeniz.googleplaycrawler.GooglePlay.SearchResponse. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GooglePlayAPI.java    From raccoon4 with Apache License 2.0 6 votes vote down vote up
/**
 * Fetches a search results for given query. Offset and numberOfResult
 * parameters are optional and <code>null</code> can be passed!
 */
public SearchResponse search(String query, Integer offset,
		Integer numberOfResult) throws IOException {

	ResponseWrapper responseWrapper = executeGETRequest(
			SEARCH_URL,
			new String[][] {
					{ "c", "3" },
					{ "q", query },
					{ "o", (offset == null) ? null : String.valueOf(offset) },
					{
							"n",
							(numberOfResult == null) ? null : String
									.valueOf(numberOfResult) }, });

	return responseWrapper.getPayload().getSearchResponse();
}
 
Example #2
Source File: SearchWorker.java    From Raccoon with Apache License 2.0 6 votes vote down vote up
private Vector<BulkDetailsEntry> doQuerySearch() throws Exception {
	GooglePlayAPI service = App.createConnection(archive);
	service.setLocalization(localization);
	SearchResponse response = service.search(search, offset, limit);

	List<String> apps = new Vector<String>();
	if (response.getDocCount() > 0) {
		DocV2 all = response.getDoc(0);
		for (int i = 0; i < all.getChildCount(); i++) {
			apps.add(all.getChild(i).getBackendDocid());
			if (fetchIcons) {
				fetchIcon(all.getChild(i));
			}
		}
	}
	BulkDetailsResponse bdr = service.bulkDetails(apps);
	Vector<BulkDetailsEntry> ret = new Vector<BulkDetailsEntry>();
	for (int i = 0; i < bdr.getEntryCount(); i++) {
		ret.add(bdr.getEntry(i));
	}
	return ret;
}
 
Example #3
Source File: GooglePlayAPI.java    From dummydroid with Apache License 2.0 5 votes vote down vote up
/**
 * Fetches a search results for given query. Offset and numberOfResult
 * parameters are optional and <code>null</code> can be passed!
 */
public SearchResponse search(String query, Integer offset, Integer numberOfResult)
		throws IOException {

	ResponseWrapper responseWrapper = executeGETRequest(SEARCH_URL, new String[][] {
			{ "c", "3" },
			{ "q", query },
			{ "o", (offset == null) ? null : String.valueOf(offset) },
			{ "n", (numberOfResult == null) ? null : String.valueOf(numberOfResult) }, });

	return responseWrapper.getPayload().getSearchResponse();
}
 
Example #4
Source File: Unwrap.java    From raccoon4 with Apache License 2.0 5 votes vote down vote up
public static SearchResponse searchResponse(ResponseWrapper rw) {
	Payload pl = payload(rw);
	if (payload(rw).hasSearchResponse()) {
		return pl.getSearchResponse();
	}
	return SearchResponse.getDefaultInstance();
}
 
Example #5
Source File: GooglePlayAPI.java    From Raccoon with Apache License 2.0 5 votes vote down vote up
/**
 * Fetches a search results for given query. Offset and numberOfResult
 * parameters are optional and <code>null</code> can be passed!
 */
public SearchResponse search(String query, Integer offset, Integer numberOfResult)
		throws IOException {

	ResponseWrapper responseWrapper = executeGETRequest(SEARCH_URL, new String[][] {
			{ "c", "3" },
			{ "q", query },
			{ "o", (offset == null) ? null : String.valueOf(offset) },
			{ "n", (numberOfResult == null) ? null : String.valueOf(numberOfResult) }, });

	return responseWrapper.getPayload().getSearchResponse();
}
 
Example #6
Source File: GooglePlayAPI.java    From dummydroid with Apache License 2.0 4 votes vote down vote up
/**
 * Equivalent of <code>search(query, null, null)</code>
 */
public SearchResponse search(String query) throws IOException {
	return search(query, null, null);
}
 
Example #7
Source File: GooglePlayAPI.java    From raccoon4 with Apache License 2.0 4 votes vote down vote up
/**
 * Equivalent of <code>search(query, null, null)</code>
 */
public SearchResponse search(String query) throws IOException {
	return search(query, null, null);
}
 
Example #8
Source File: GooglePlayAPI.java    From Raccoon with Apache License 2.0 4 votes vote down vote up
/**
 * Equivalent of <code>search(query, null, null)</code>
 */
public SearchResponse search(String query) throws IOException {
	return search(query, null, null);
}