@Override void retrieveSupplementalInfo() throws IOException { URI oldURI; try { oldURI = new URI(result.getURI()); } catch (URISyntaxException ignored) { return; } URI newURI = HttpHelper.unredirect(oldURI); int count = 0; while (count++ < MAX_REDIRECTS && !oldURI.equals(newURI)) { append( result.getDisplayResult(), null, new String[] {redirectString + " : " + newURI}, newURI.toString()); oldURI = newURI; newURI = HttpHelper.unredirect(newURI); } }
@Override void retrieveSupplementalInfo() { CharSequence contents; try { contents = HttpHelper.downloadViaHttp(httpUrl, HttpHelper.ContentType.HTML, 4096); } catch (IOException ioe) { // ignore this return; } if (contents != null && contents.length() > 0) { Matcher m = TITLE_PATTERN.matcher(contents); if (m.find()) { String title = m.group(1); if (title != null && !title.isEmpty()) { if (title.length() > MAX_TITLE_LEN) { title = title.substring(0, MAX_TITLE_LEN) + "..."; } append(httpUrl, null, new String[] {title}, httpUrl); } } } }