|
|
|
@ -556,31 +556,18 @@ public class yacysearch {
|
|
|
|
|
}
|
|
|
|
|
final String recommendHash = post.get("recommendref", ""); // urlhash
|
|
|
|
|
final URIMetadataNode urlentry = indexSegment.fulltext().getMetadata(UTF8.getBytes(recommendHash));
|
|
|
|
|
if ( urlentry != null ) {
|
|
|
|
|
Document[] documents = null;
|
|
|
|
|
try {
|
|
|
|
|
documents =
|
|
|
|
|
sb.loader.loadDocuments(
|
|
|
|
|
sb.loader.request(urlentry.url(), true, false),
|
|
|
|
|
CacheStrategy.IFEXIST,
|
|
|
|
|
Integer.MAX_VALUE, BlacklistType.SEARCH, ClientIdentification.yacyIntranetCrawlerAgent);
|
|
|
|
|
} catch (final IOException e ) {
|
|
|
|
|
} catch (final Parser.Failure e ) {
|
|
|
|
|
}
|
|
|
|
|
if ( documents != null ) {
|
|
|
|
|
// create a news message
|
|
|
|
|
final Map<String, String> map = new HashMap<String, String>();
|
|
|
|
|
map.put("url", urlentry.url().toNormalform(true).replace(',', '|'));
|
|
|
|
|
map.put("title", urlentry.dc_title().replace(',', ' '));
|
|
|
|
|
map.put("description", documents[0].dc_title().replace(',', ' '));
|
|
|
|
|
map.put("author", documents[0].dc_creator());
|
|
|
|
|
map.put("tags", documents[0].dc_subject(' '));
|
|
|
|
|
sb.peers.newsPool.publishMyNews(
|
|
|
|
|
if (urlentry != null) {
|
|
|
|
|
// create a news message
|
|
|
|
|
final Map<String, String> map = new HashMap<String, String>();
|
|
|
|
|
map.put("url", urlentry.url().toNormalform(true).replace(',', '|'));
|
|
|
|
|
map.put("title", urlentry.dc_title().replace(',', ' '));
|
|
|
|
|
map.put("description", urlentry.getDescription().isEmpty() ? urlentry.dc_title().replace(',', ' ') : urlentry.getDescription().get(0).replace(',', ' '));
|
|
|
|
|
map.put("author", urlentry.dc_creator());
|
|
|
|
|
map.put("tags", urlentry.dc_subject().replace(',', ' '));
|
|
|
|
|
sb.peers.newsPool.publishMyNews(
|
|
|
|
|
sb.peers.mySeed(),
|
|
|
|
|
NewsPool.CATEGORY_SURFTIPP_ADD,
|
|
|
|
|
map);
|
|
|
|
|
documents[0].close();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|