mirror of
https://github.com/yacy/yacy_search_server.git
synced 2025-07-17 08:26:08 -04:00
Fix some of the issues with the RSS search interface, see http://forum.yacy-websuche.de/viewtopic.php?f=6&t=392
Note: the new DateFormatter822 in the plasmaSwitchboard is just a copy of the DateFormatter that always uses the US locale to allow formatting of a loocale independent date String. git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4124 6c8d7289-2bf4-0310-a012-ef5d649a1542
This commit is contained in:
@ -11,9 +11,9 @@
|
||||
<url>#[rssYacyImageURL]#</url>
|
||||
<title>Search for #[former]#</title>
|
||||
</image>
|
||||
<opensearch:totalResults>#[type_results]#</opensearch:totalResults>
|
||||
<opensearch:totalResults>#[results]#</opensearch:totalResults>
|
||||
<opensearch:startIndex>1</opensearch:startIndex>
|
||||
<opensearch:itemsPerPage>#[type_results]#</opensearch:itemsPerPage>
|
||||
<opensearch:itemsPerPage>#[results]#</opensearch:itemsPerPage>
|
||||
<opensearch:link rel="search" href="opensearchdescription.xml" type="application/opensearchdescription+xml"/>
|
||||
<opensearch:Query role="request" searchTerms="#[former]#" />
|
||||
|
||||
|
@ -178,7 +178,7 @@ public class yacysearchitem {
|
||||
prop.put("rss_description", result.textSnippet().getLineRaw());
|
||||
prop.put("rss_link", result.urlstring());
|
||||
prop.put("rss_urlhash", result.hash());
|
||||
prop.put("rss_date", plasmaSwitchboard.dateString(result.modified()));
|
||||
prop.put("rss_date", plasmaSwitchboard.dateString822(result.modified()));
|
||||
return prop;
|
||||
}
|
||||
|
||||
|
@ -117,6 +117,7 @@ import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Hashtable;
|
||||
import java.util.Iterator;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
@ -2895,6 +2896,13 @@ public final class plasmaSwitchboard extends serverAbstractSwitch implements ser
|
||||
if (date == null) return ""; else return DateFormatter.format(date);
|
||||
}
|
||||
|
||||
// we need locale independent RFC-822 dates at some places
|
||||
private static SimpleDateFormat DateFormatter822 = new SimpleDateFormat("EEE, dd MMM yyyy", Locale.US);
|
||||
public static String dateString822(Date date) {
|
||||
if (date == null) return ""; else return DateFormatter822.format(date);
|
||||
}
|
||||
|
||||
|
||||
public serverObjects action(String actionName, serverObjects actionInput) {
|
||||
// perform an action. (not used)
|
||||
return null;
|
||||
|
Reference in New Issue
Block a user