Skip to content

Commit

Permalink
Fix some of the issues with the RSS search interface, see http://foru…
Browse files Browse the repository at this point in the history
…m.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
  • Loading branch information
fuchsi committed Oct 2, 2007
1 parent 98abe08 commit 7404f2c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions htroot/yacysearch.rss
Expand Up @@ -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]#" />

Expand Down
2 changes: 1 addition & 1 deletion htroot/yacysearchitem.java
Expand Up @@ -178,7 +178,7 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
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;
}

Expand Down
8 changes: 8 additions & 0 deletions source/de/anomic/plasma/plasmaSwitchboard.java
Expand Up @@ -117,6 +117,7 @@ this class is also the core of the http crawling.
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;
Expand Down Expand Up @@ -2895,6 +2896,13 @@ public static String dateString(Date date) {
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;
Expand Down

0 comments on commit 7404f2c

Please sign in to comment.