+ Added interface method in SearchEngine class for fetch search suggestion list.
+ Implemented SearchEngine Interface method in YoutubeSearchEngine class.
This commit is contained in:
parent
fc32377ce7
commit
68a0eefa20
|
@ -32,4 +32,6 @@ public interface SearchEngine {
|
|||
}
|
||||
|
||||
Result search(String query, int page);
|
||||
|
||||
Result suggestionList(String query);
|
||||
}
|
||||
|
|
|
@ -115,4 +115,23 @@ public class YoutubeSearchEngine implements SearchEngine {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result suggestionList(String query) {
|
||||
|
||||
// http://suggestqueries.google.com/complete/search?client=youtube&ds=yt&q=andro
|
||||
|
||||
Uri.Builder builder = new Uri.Builder();
|
||||
builder.scheme("https")
|
||||
.authority("suggestqueries.google.com")
|
||||
.appendPath("complete")
|
||||
.appendPath("search")
|
||||
.appendQueryParameter("client", "youtube")
|
||||
.appendQueryParameter("ds", "yt")
|
||||
.appendQueryParameter("q", query);
|
||||
String url = builder.build().toString();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue