+ Added interface method in SearchEngine class for fetch search suggestion list.

+ Implemented SearchEngine Interface method in YoutubeSearchEngine class.
pull/73/head
chandrashekhar 2015-11-03 13:32:05 +05:30
rodzic fc32377ce7
commit 68a0eefa20
2 zmienionych plików z 21 dodań i 0 usunięć

Wyświetl plik

@ -32,4 +32,6 @@ public interface SearchEngine {
} }
Result search(String query, int page); Result search(String query, int page);
Result suggestionList(String query);
} }

Wyświetl plik

@ -115,4 +115,23 @@ public class YoutubeSearchEngine implements SearchEngine {
} }
return result; 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;
}
} }