more fixes to the yacysearch.rss, it's now 100% valid according to http://feedvalidator.org

- RFC-822 date time had to include the time instead of date only
- <opensearch:link> doesn't exist -> <atom:link>, see http://www.opensearch.org/Specifications/OpenSearch/1.1
- <link> elements are mandatory for <channel> and <item>

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4131 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
fuchsi 18 years ago
parent e3c6236eef
commit 03c5b4ad68

@ -381,6 +381,7 @@ public class yacysearch {
// adding some additional properties needed for the rss feed
String hostName = (String) header.get("Host", "localhost");
if (hostName.indexOf(":") == -1) hostName += ":" + serverCore.getPortNr(env.getConfig("port", "8080"));
prop.put("searchBaseURL", "http://" + hostName + "/yacysearch.html");
prop.put("rssYacyImageURL", "http://" + hostName + "/env/grafics/yacy.gif");
}

@ -2,19 +2,22 @@
<?xml-stylesheet type='text/xsl' href='/yacysearch.xsl' version='1.0'?>
<rss version="2.0"
xmlns:yacyTopwords="http://www.yacy.net/yacy/topwords"
xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom">
<!-- YaCy P2P Web Search - Results; http://yacy.net -->
<channel>
<title>YaCy P2P-Search for #[former]#</title>
<description>Search for #[former]#</description>
<link>#[searchBaseURL]#?search=#[former]#&amp;resource=#[input_resource]#&amp;contentdom=#[input_contentdom]#</link>
<image>
<url>#[rssYacyImageURL]#</url>
<title>Search for #[former]#</title>
<link>#[searchBaseURL]#?search=#[former]#&amp;resource=#[input_resource]#&amp;contentdom=#[input_contentdom]#</link>
</image>
<opensearch:totalResults>#[num-results_totalcount]#</opensearch:totalResults>
<opensearch:startIndex>#[num-results_offset]#</opensearch:startIndex>
<opensearch:itemsPerPage>#[num-results_itemsPerPage]#</opensearch:itemsPerPage>
<opensearch:link rel="search" href="opensearchdescription.xml" type="application/opensearchdescription+xml"/>
<atom:link rel="related" href="opensearchdescription.xml" type="application/opensearchdescription+xml"/>
<opensearch:Query role="request" searchTerms="#[former]#" />
#{results}#

@ -2897,7 +2897,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
}
// we need locale independent RFC-822 dates at some places
private static SimpleDateFormat DateFormatter822 = new SimpleDateFormat("EEE, dd MMM yyyy", Locale.US);
private static SimpleDateFormat DateFormatter822 = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", Locale.US);
public static String dateString822(Date date) {
if (date == null) return ""; else return DateFormatter822.format(date);
}

Loading…
Cancel
Save