*
* @param search
* the term to search for
+ * @param page
+ * the page to use for result pagination, index is 1-based
*
* @return a list of stories that satisfy that search term
*
* @throws IOException
* in case of I/O error
*/
- abstract public List<MetaData> search(String search) throws IOException;
+ abstract public List<MetaData> search(String search, int page)
+ throws IOException;
/**
* Search for the given tag and return a list of stories satisfying this
* <p>
* URL is guaranteed to be usable, LUID will always be NULL.
*
- * @param tagId
+ * @param tag
* the tag to search for
* @param page
* the page to use for result pagination (see
}
@Override
- public List<MetaData> search(String search) throws IOException {
+ public List<MetaData> search(String search, int page) throws IOException {
String encoded = URLEncoder.encode(search.toLowerCase(), "utf-8");
return getStories(BASE_URL + "search/?ready=1&type=story&keywords="
- + encoded, null, null);
+ + encoded + "&ppage=" + page, null, null);
}
@Override
* the document
*
* @return the number of pages or -1 if unknown
- *
- * @throws IOException
- * in case of I/O errors
*/
- private int getPages(Document doc) throws IOException {
+ private int getPages(Document doc) {
int pages = -1;
if (doc != null) {